import { AcceleratedAnimation, AnimatePresence, DeprecatedLayoutGroupContext, DragControls, FlatTree, LayoutGroup, LazyMotion, MotionConfig, MotionConfigContext, MotionContext, MotionGlobalConfig, MotionValue, PresenceContext, Reorder, SwitchLayoutGroupContext, VisualElement, __commonJS, __privateAdd, __privateGet, __privateMethod, __privateSet, __publicField, __toESM, addPointerEvent, addPointerInfo, addScaleCorrector, animate, animateValue, animateVisualElement, animationControls, animations, anticipate, backIn, backInOut, backOut, buildTransform, calcLength, cancelFrame, cancelSync, circIn, circInOut, circOut, clamp, color, complex, createBox, createDomMotionComponent, createMotionComponent, createScopedAnimate, cubicBezier, delay, disableInstantTransitions, distance, distance2D, domAnimation, domMax, easeIn, easeInOut, easeOut, filterProps, frame, frameData, inView, interpolate, invariant, isBrowser, isDragActive, isMotionComponent, isMotionValue, isValidMotionProp, m, makeUseVisualState, mirrorEasing, mix, motion, motionValue, optimizedAppearDataAttribute, pipe, progress, px, resolveMotionValue, reverseEasing, scroll, scrollInfo, spring, stagger, startOptimizedAppearAnimation, steps, sync, transform, unwrapMotionComponent, useAnimate, useAnimatedState, useAnimation, useAnimationControls, useAnimationFrame, useCycle, useDomEvent, useDragControls, useElementScroll, useForceUpdate, useInView, useInstantLayoutTransition, useInstantTransition, useInvertedScale, useIsPresent, useIsomorphicLayoutEffect, useMotionTemplate, useMotionValue, useMotionValueEvent, usePresence, useReducedMotion, useReducedMotionConfig, useResetProjection, useScroll, useSpring, useTime, useTransform, useUnmountEffect, useVelocity, useViewportScroll, useWillChange, visualElementStore, warning, wrap } from "./chunk-DUHOOT7P.js"; // ../../../node_modules/hsluv/dist/hsluv.cjs var require_hsluv = __commonJS({ "../../../node_modules/hsluv/dist/hsluv.cjs"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Hsluv = void 0; var Hsluv2 = class { constructor() { this.hex = "#000000"; this.rgb_r = 0; this.rgb_g = 0; this.rgb_b = 0; this.xyz_x = 0; this.xyz_y = 0; this.xyz_z = 0; this.luv_l = 0; this.luv_u = 0; this.luv_v = 0; this.lch_l = 0; this.lch_c = 0; this.lch_h = 0; this.hsluv_h = 0; this.hsluv_s = 0; this.hsluv_l = 0; this.hpluv_h = 0; this.hpluv_p = 0; this.hpluv_l = 0; this.r0s = 0; this.r0i = 0; this.r1s = 0; this.r1i = 0; this.g0s = 0; this.g0i = 0; this.g1s = 0; this.g1i = 0; this.b0s = 0; this.b0i = 0; this.b1s = 0; this.b1i = 0; } static fromLinear(c) { if (c <=3 1308e-7) { return 12.92 * c; } else { return 1.055 * Math.pow(c, 1 / 2.4) - 0.055; } } static toLinear(c) { if (c> 0.04045) { return Math.pow((c + 0.055) / 1.055, 2.4); } else { return c / 12.92; } } static yToL(Y) { if (Y <=H sluv2.epsilon) { return Y / Hsluv2.refY * Hsluv2.kappa; } else { return 116 * Math.pow(Y / Hsluv2.refY, 1 / 3) - 16; } } static lToY(L) { if (L <=8 ) { return Hsluv2.refY * L / Hsluv2.kappa; } else { return Hsluv2.refY * Math.pow((L + 16) / 116, 3); } } static rgbChannelToHex(chan) { const c=M ath.round(chan * 255); const digit2=c % 16; const digit1=( c - digit2) / 16 | 0; return Hsluv2.hexChars.charAt(digit1) + Hsluv2.hexChars.charAt(digit2); } static hexToRgbChannel(hex, offset) { const digit1=H sluv2.hexChars.indexOf(hex.charAt(offset)); const digit2=H sluv2.hexChars.indexOf(hex.charAt(offset + 1)); const n=d igit1 * 16 + digit2; return n / 255; } static distanceFromOriginAngle(slope, intercept, angle) { const d=i ntercept / (Math.sin(angle) - slope * Math.cos(angle)); if (d < 0) { return Infinity; } else { return d; } } static distanceFromOrigin(slope, intercept) { return Math.abs(intercept) / Math.sqrt(Math.pow(slope, 2) + 1); } static min6(f1, f2, f3, f4, f5, f6) { return Math.min(f1, Math.min(f2, Math.min(f3, Math.min(f4, Math.min(f5, f6))))); } rgbToHex() { this.hex="#" ; this.hex +=H sluv2.rgbChannelToHex(this.rgb_r); this.hex +=H sluv2.rgbChannelToHex(this.rgb_g); this.hex +=H sluv2.rgbChannelToHex(this.rgb_b); } hexToRgb() { this.hex=t his.hex.toLowerCase(); this.rgb_r=H sluv2.hexToRgbChannel(this.hex, 1); this.rgb_g=H sluv2.hexToRgbChannel(this.hex, 3); this.rgb_b=H sluv2.hexToRgbChannel(this.hex, 5); } xyzToRgb() { this.rgb_r=H sluv2.fromLinear(Hsluv2.m_r0 * this.xyz_x + Hsluv2.m_r1 * this.xyz_y + Hsluv2.m_r2 * this.xyz_z); this.rgb_g=H sluv2.fromLinear(Hsluv2.m_g0 * this.xyz_x + Hsluv2.m_g1 * this.xyz_y + Hsluv2.m_g2 * this.xyz_z); this.rgb_b=H sluv2.fromLinear(Hsluv2.m_b0 * this.xyz_x + Hsluv2.m_b1 * this.xyz_y + Hsluv2.m_b2 * this.xyz_z); } rgbToXyz() { const lr=H sluv2.toLinear(this.rgb_r); const lg=H sluv2.toLinear(this.rgb_g); const lb=H sluv2.toLinear(this.rgb_b); this.xyz_x=0 .41239079926595 * lr + 0.35758433938387 * lg + 0.18048078840183 * lb; this.xyz_y=0 .21263900587151 * lr + 0.71516867876775 * lg + 0.072192315360733 * lb; this.xyz_z=0 .019330818715591 * lr + 0.11919477979462 * lg + 0.95053215224966 * lb; } xyzToLuv() { const divider=t his.xyz_x + 15 * this.xyz_y + 3 * this.xyz_z; let varU=4 * this.xyz_x; let varV=9 * this.xyz_y; if (divider !==0 ) { varU /=d ivider; varV /=d ivider; } else { varU=N aN; varV=N aN; } this.luv_l=H sluv2.yToL(this.xyz_y); if (this.luv_l===0 ) { this.luv_u=0 ; this.luv_v=0 ; } else { this.luv_u=1 3 * this.luv_l * (varU - Hsluv2.refU); this.luv_v=1 3 * this.luv_l * (varV - Hsluv2.refV); } } luvToXyz() { if (this.luv_l===0 ) { this.xyz_x=0 ; this.xyz_y=0 ; this.xyz_z=0 ; return; } const varU=t his.luv_u / (13 * this.luv_l) + Hsluv2.refU; const varV=t his.luv_v / (13 * this.luv_l) + Hsluv2.refV; this.xyz_y=H sluv2.lToY(this.luv_l); this.xyz_x=0 - 9 * this.xyz_y * varU / ((varU - 4) * varV - varU * varV); this.xyz_z=( 9 * this.xyz_y - 15 * varV * this.xyz_y - varV * this.xyz_x) / (3 * varV); } luvToLch() { this.lch_l=t his.luv_l; this.lch_c=M ath.sqrt(this.luv_u * this.luv_u + this.luv_v * this.luv_v); if (this.lch_c < 1e-8) { this.lch_h=0 ; } else { const hrad=M ath.atan2(this.luv_v, this.luv_u); this.lch_h=h rad * 180 / Math.PI; if (this.lch_h < 0) { this.lch_h=3 60 + this.lch_h; } } } lchToLuv() { const hrad=t his.lch_h / 180 * Math.PI; this.luv_l=t his.lch_l; this.luv_u=M ath.cos(hrad) * this.lch_c; this.luv_v=M ath.sin(hrad) * this.lch_c; } calculateBoundingLines(l) { const sub1=M ath.pow(l + 16, 3) / 1560896; const sub2=s ub1> Hsluv2.epsilon ? sub1 : l / Hsluv2.kappa; const s1r = sub2 * (284517 * Hsluv2.m_r0 - 94839 * Hsluv2.m_r2); const s2r = sub2 * (838422 * Hsluv2.m_r2 + 769860 * Hsluv2.m_r1 + 731718 * Hsluv2.m_r0); const s3r = sub2 * (632260 * Hsluv2.m_r2 - 126452 * Hsluv2.m_r1); const s1g = sub2 * (284517 * Hsluv2.m_g0 - 94839 * Hsluv2.m_g2); const s2g = sub2 * (838422 * Hsluv2.m_g2 + 769860 * Hsluv2.m_g1 + 731718 * Hsluv2.m_g0); const s3g = sub2 * (632260 * Hsluv2.m_g2 - 126452 * Hsluv2.m_g1); const s1b = sub2 * (284517 * Hsluv2.m_b0 - 94839 * Hsluv2.m_b2); const s2b = sub2 * (838422 * Hsluv2.m_b2 + 769860 * Hsluv2.m_b1 + 731718 * Hsluv2.m_b0); const s3b = sub2 * (632260 * Hsluv2.m_b2 - 126452 * Hsluv2.m_b1); this.r0s = s1r / s3r; this.r0i = s2r * l / s3r; this.r1s = s1r / (s3r + 126452); this.r1i = (s2r - 769860) * l / (s3r + 126452); this.g0s = s1g / s3g; this.g0i = s2g * l / s3g; this.g1s = s1g / (s3g + 126452); this.g1i = (s2g - 769860) * l / (s3g + 126452); this.b0s = s1b / s3b; this.b0i = s2b * l / s3b; this.b1s = s1b / (s3b + 126452); this.b1i = (s2b - 769860) * l / (s3b + 126452); } calcMaxChromaHpluv() { const r0 = Hsluv2.distanceFromOrigin(this.r0s, this.r0i); const r1 = Hsluv2.distanceFromOrigin(this.r1s, this.r1i); const g0 = Hsluv2.distanceFromOrigin(this.g0s, this.g0i); const g1 = Hsluv2.distanceFromOrigin(this.g1s, this.g1i); const b0 = Hsluv2.distanceFromOrigin(this.b0s, this.b0i); const b1 = Hsluv2.distanceFromOrigin(this.b1s, this.b1i); return Hsluv2.min6(r0, r1, g0, g1, b0, b1); } calcMaxChromaHsluv(h) { const hueRad = h / 360 * Math.PI * 2; const r0 = Hsluv2.distanceFromOriginAngle(this.r0s, this.r0i, hueRad); const r1 = Hsluv2.distanceFromOriginAngle(this.r1s, this.r1i, hueRad); const g0 = Hsluv2.distanceFromOriginAngle(this.g0s, this.g0i, hueRad); const g1 = Hsluv2.distanceFromOriginAngle(this.g1s, this.g1i, hueRad); const b0 = Hsluv2.distanceFromOriginAngle(this.b0s, this.b0i, hueRad); const b1 = Hsluv2.distanceFromOriginAngle(this.b1s, this.b1i, hueRad); return Hsluv2.min6(r0, r1, g0, g1, b0, b1); } hsluvToLch() { if (this.hsluv_l > 99.9999999) { this.lch_l = 100; this.lch_c = 0; } else if (this.hsluv_l < 1e-8) { this.lch_l=0 ; this.lch_c=0 ; } else { this.lch_l=t his.hsluv_l; this.calculateBoundingLines(this.hsluv_l); const max=t his.calcMaxChromaHsluv(this.hsluv_h); this.lch_c=m ax / 100 * this.hsluv_s; } this.lch_h=t his.hsluv_h; } lchToHsluv() { if (this.lch_l> 99.9999999) { this.hsluv_s = 0; this.hsluv_l = 100; } else if (this.lch_l < 1e-8) { this.hsluv_s=0 ; this.hsluv_l=0 ; } else { this.calculateBoundingLines(this.lch_l); const max=t his.calcMaxChromaHsluv(this.lch_h); this.hsluv_s=t his.lch_c / max * 100; this.hsluv_l=t his.lch_l; } this.hsluv_h=t his.lch_h; } hpluvToLch() { if (this.hpluv_l> 99.9999999) { this.lch_l = 100; this.lch_c = 0; } else if (this.hpluv_l < 1e-8) { this.lch_l=0 ; this.lch_c=0 ; } else { this.lch_l=t his.hpluv_l; this.calculateBoundingLines(this.hpluv_l); const max=t his.calcMaxChromaHpluv(); this.lch_c=m ax / 100 * this.hpluv_p; } this.lch_h=t his.hpluv_h; } lchToHpluv() { if (this.lch_l> 99.9999999) { this.hpluv_p = 0; this.hpluv_l = 100; } else if (this.lch_l < 1e-8) { this.hpluv_p=0 ; this.hpluv_l=0 ; } else { this.calculateBoundingLines(this.lch_l); const max=t his.calcMaxChromaHpluv(); this.hpluv_p=t his.lch_c / max * 100; this.hpluv_l=t his.lch_l; } this.hpluv_h=t his.lch_h; } hsluvToRgb() { this.hsluvToLch(); this.lchToLuv(); this.luvToXyz(); this.xyzToRgb(); } hpluvToRgb() { this.hpluvToLch(); this.lchToLuv(); this.luvToXyz(); this.xyzToRgb(); } hsluvToHex() { this.hsluvToRgb(); this.rgbToHex(); } hpluvToHex() { this.hpluvToRgb(); this.rgbToHex(); } rgbToHsluv() { this.rgbToXyz(); this.xyzToLuv(); this.luvToLch(); this.lchToHpluv(); this.lchToHsluv(); } rgbToHpluv() { this.rgbToXyz(); this.xyzToLuv(); this.luvToLch(); this.lchToHpluv(); this.lchToHpluv(); } hexToHsluv() { this.hexToRgb(); this.rgbToHsluv(); } hexToHpluv() { this.hexToRgb(); this.rgbToHpluv(); } }; exports.Hsluv=H sluv2; Hsluv2.hexChars="0123456789abcdef" ; Hsluv2.refY=1 ; Hsluv2.refU=0 .19783000664283; Hsluv2.refV=0 .46831999493879; Hsluv2.kappa=9 03.2962962; Hsluv2.epsilon=0 .0088564516; Hsluv2.m_r0=3 .240969941904521; Hsluv2.m_r1=- 1.537383177570093; Hsluv2.m_r2=- 0.498610760293; Hsluv2.m_g0=- 0.96924363628087; Hsluv2.m_g1=1 .87596750150772; Hsluv2.m_g2=0 .041555057407175; Hsluv2.m_b0=0 .055630079696993; Hsluv2.m_b1=- 0.20397695888897; Hsluv2.m_b2=1 .056971514242878; } }); // ../../../node_modules/eventemitter3/index.js var require_eventemitter3=_ _commonJS({ "../../../node_modules/eventemitter3/index.js"(exports, module) { "use strict"; var has=O bject.prototype.hasOwnProperty; var prefix2="~" ; function Events() { } if (Object.create) { Events.prototype=/ * @__PURE__ */ Object.create(null); if (!new Events().__proto__) prefix2=f alse; } function EE(fn, context, once) { this.fn=f n; this.context=c ontext; this.once=o nce || false; } function addListener(emitter, event, fn, context, once) { if (typeof fn !=="function" ) { throw new TypeError( "The listener must be a function"); } var listener=n ew EE(fn, context || emitter, once), evt=p refix2 ? prefix2 + event : event; if (!emitter._events[evt]) emitter._events[evt]=l istener, emitter._eventsCount++; else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); else emitter._events[evt]=[ emitter._events[evt], listener]; return emitter; } function clearEvent(emitter, evt) { if (--emitter._eventsCount===0 ) emitter._events=n ew Events(); else delete emitter._events[evt]; } function EventEmitter2() { this._events=n ew Events(); this._eventsCount=0 ; } EventEmitter2.prototype.eventNames=f unction eventNames() { var names=[ ], events, name; if (this._eventsCount===0 ) return names; for (name in events=t his._events) { if (has.call(events, name)) names.push(prefix2 ? name.slice(1) : name); } if (Object.getOwnPropertySymbols) { return names.concat(Object.getOwnPropertySymbols(events)); } return names; }; EventEmitter2.prototype.listeners=f unction listeners(event) { var evt=p refix2 ? prefix2 + event : event, handlers=t his._events[evt]; if (!handlers) return []; if (handlers.fn) return [handlers.fn]; for (var i=0 , l=h andlers.length, ee=n ew Array(l); i < l; i++) { ee[i]=h andlers[i].fn; } return ee; }; EventEmitter2.prototype.listenerCount=f unction listenerCount(event) { var evt=p refix2 ? prefix2 + event : event, listeners=t his._events[evt]; if (!listeners) return 0; if (listeners.fn) return 1; return listeners.length; }; EventEmitter2.prototype.emit=f unction emit(event, a1, a2, a3, a4, a5) { var evt=p refix2 ? prefix2 + event : event; if (!this._events[evt]) return false; var listeners=t his._events[evt], len=a rguments.length, args, i; if (listeners.fn) { if (listeners.once) this.removeListener(event, listeners.fn, void 0, true); switch (len) { case 1: return listeners.fn.call(listeners.context), true; case 2: return listeners.fn.call(listeners.context, a1), true; case 3: return listeners.fn.call(listeners.context, a1, a2), true; case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; } for (i=1 , args=n ew Array(len - 1); i < len; i++) { args[i - 1]=a rguments[i]; } listeners.fn.apply(listeners.context, args); } else { var length=l isteners.length, j; for (i=0 ; i < length; i++) { if (listeners[i].once) this.removeListener(event, listeners[i].fn, void 0, true); switch (len) { case 1: listeners[i].fn.call(listeners[i].context); break; case 2: listeners[i].fn.call(listeners[i].context, a1); break; case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; default: if (!args) for (j=1 , args=n ew Array(len - 1); j < len; j++) { args[j - 1]=a rguments[j]; } listeners[i].fn.apply(listeners[i].context, args); } } } return true; }; EventEmitter2.prototype.on=f unction on(event, fn, context) { return addListener(this, event, fn, context, false); }; EventEmitter2.prototype.once=f unction once(event, fn, context) { return addListener(this, event, fn, context, true); }; EventEmitter2.prototype.removeListener=f unction removeListener(event, fn, context, once) { var evt=p refix2 ? prefix2 + event : event; if (!this._events[evt]) return this; if (!fn) { clearEvent(this, evt); return this; } var listeners=t his._events[evt]; if (listeners.fn) { if (listeners.fn===f n && (!once || listeners.once) && (!context || listeners.context===c ontext)) { clearEvent(this, evt); } } else { for (var i=0 , events=[ ], length=l isteners.length; i < length; i++) { if (listeners[i].fn !==f n || once && !listeners[i].once || context && listeners[i].context !==c ontext) { events.push(listeners[i]); } } if (events.length) this._events[evt]=e vents.length===1 ? events[0] : events; else clearEvent(this, evt); } return this; }; EventEmitter2.prototype.removeAllListeners=f unction removeAllListeners(event) { var evt; if (event) { evt=p refix2 ? prefix2 + event : event; if (this._events[evt]) clearEvent(this, evt); } else { this._events=n ew Events(); this._eventsCount=0 ; } return this; }; EventEmitter2.prototype.off=E ventEmitter2.prototype.removeListener; EventEmitter2.prototype.addListener=E ventEmitter2.prototype.on; EventEmitter2.prefixed=p refix2; EventEmitter2.EventEmitter=E ventEmitter2; if ( "undefined" !==t ypeof module) { module.exports=E ventEmitter2; } } }); // ../../../node_modules/process/browser.js var require_browser=_ _commonJS({ "../../../node_modules/process/browser.js"(exports, module) { var process5=m odule.exports={ }; var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error( "setTimeout has not been defined"); } function defaultClearTimeout() { throw new Error( "clearTimeout has not been defined"); } (function() { try { if (typeof setTimeout==="function" ) { cachedSetTimeout=s etTimeout; } else { cachedSetTimeout=d efaultSetTimout; } } catch (e) { cachedSetTimeout=d efaultSetTimout; } try { if (typeof clearTimeout==="function" ) { cachedClearTimeout=c learTimeout; } else { cachedClearTimeout=d efaultClearTimeout; } } catch (e) { cachedClearTimeout=d efaultClearTimeout; } })(); function runTimeout(fun) { if (cachedSetTimeout===s etTimeout) { return setTimeout(fun, 0); } if ((cachedSetTimeout===d efaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout=s etTimeout; return setTimeout(fun, 0); } try { return cachedSetTimeout(fun, 0); } catch (e) { try { return cachedSetTimeout.call(null, fun, 0); } catch (e2) { return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout===c learTimeout) { return clearTimeout(marker); } if ((cachedClearTimeout===d efaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout=c learTimeout; return clearTimeout(marker); } try { return cachedClearTimeout(marker); } catch (e) { try { return cachedClearTimeout.call(null, marker); } catch (e2) { return cachedClearTimeout.call(this, marker); } } } var queue=[ ]; var draining=f alse; var currentQueue; var queueIndex=- 1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining=f alse; if (currentQueue.length) { queue=c urrentQueue.concat(queue); } else { queueIndex=- 1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout=r unTimeout(cleanUpNextTick); draining=t rue; var len=q ueue.length; while (len) { currentQueue=q ueue; queue=[ ]; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex=- 1; len=q ueue.length; } currentQueue=n ull; draining=f alse; runClearTimeout(timeout); } process5.nextTick=f unction(fun) { var args=n ew Array(arguments.length - 1); if (arguments.length> 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1]=a rguments[i]; } } queue.push(new Item(fun, args)); if (queue.length===1 && !draining) { runTimeout(drainQueue); } }; function Item(fun, array) { this.fun=f un; this.array=a rray; } Item.prototype.run=f unction() { this.fun.apply(null, this.array); }; process5.title="browser" ; process5.browser=t rue; process5.env={ }; process5.argv=[ ]; process5.version="" ; process5.versions={ }; function noop() { } process5.on=n oop; process5.addListener=n oop; process5.once=n oop; process5.off=n oop; process5.removeListener=n oop; process5.removeAllListeners=n oop; process5.emit=n oop; process5.prependListener=n oop; process5.prependOnceListener=n oop; process5.listeners=f unction(name) { return []; }; process5.binding=f unction(name) { throw new Error( "process.binding is not supported"); }; process5.cwd=f unction() { return "/"; }; process5.chdir=f unction(dir) { throw new Error( "process.chdir is not supported"); }; process5.umask=f unction() { return 0; }; } }); // ../../../node_modules/@juggle/resize-observer/lib/exports/resize-observer.umd.js var require_resize_observer_umd=_ _commonJS({ "../../../node_modules/@juggle/resize-observer/lib/exports/resize-observer.umd.js"(exports, module) { (function(global, factory) { typeof exports==="object" && typeof module !=="undefined" ? factory(exports) : typeof define==="function" && define.amd ? define([ "exports"], factory) : (global=t ypeof globalThis !=="undefined" ? globalThis : global || self, factory(global.ResizeObserver={ })); })(exports, function(exports2) { "use strict"; var resizeObservers=[ ]; var hasActiveObservations=f unction() { return resizeObservers.some(function(ro) { return ro.activeTargets.length> 0; }); }; var hasSkippedObservations = function() { return resizeObservers.some(function(ro) { return ro.skippedTargets.length > 0; }); }; var msg = "ResizeObserver loop completed with undelivered notifications."; var deliverResizeLoopError = function() { var event; if (typeof ErrorEvent === "function") { event = new ErrorEvent("error", { message: msg }); } else { event = document.createEvent("Event"); event.initEvent("error", false, false); event.message = msg; } window.dispatchEvent(event); }; var ResizeObserverBoxOptions; (function(ResizeObserverBoxOptions2) { ResizeObserverBoxOptions2["BORDER_BOX"] = "border-box"; ResizeObserverBoxOptions2["CONTENT_BOX"] = "content-box"; ResizeObserverBoxOptions2["DEVICE_PIXEL_CONTENT_BOX"] = "device-pixel-content-box"; })(ResizeObserverBoxOptions || (ResizeObserverBoxOptions = {})); var freeze = function(obj) { return Object.freeze(obj); }; var ResizeObserverSize = function() { function ResizeObserverSize2(inlineSize, blockSize) { this.inlineSize = inlineSize; this.blockSize = blockSize; freeze(this); } return ResizeObserverSize2; }(); var DOMRectReadOnly = function() { function DOMRectReadOnly2(x, y, width, height) { this.x = x; this.y = y; this.width = width; this.height = height; this.top = this.y; this.left = this.x; this.bottom = this.top + this.height; this.right = this.left + this.width; return freeze(this); } DOMRectReadOnly2.prototype.toJSON = function() { var _a = this, x = _a.x, y = _a.y, top = _a.top, right = _a.right, bottom = _a.bottom, left = _a.left, width = _a.width, height = _a.height; return { x, y, top, right, bottom, left, width, height }; }; DOMRectReadOnly2.fromRect = function(rectangle) { return new DOMRectReadOnly2(rectangle.x, rectangle.y, rectangle.width, rectangle.height); }; return DOMRectReadOnly2; }(); var isSVG = function(target) { return target instanceof SVGElement && "getBBox" in target; }; var isHidden = function(target) { if (isSVG(target)) { var _a = target.getBBox(), width = _a.width, height = _a.height; return !width && !height; } var _b = target, offsetWidth = _b.offsetWidth, offsetHeight = _b.offsetHeight; return !(offsetWidth || offsetHeight || target.getClientRects().length); }; var isElement = function(obj) { var _a, _b; if (obj instanceof Element) { return true; } var scope = (_b = (_a = obj) === null || _a === void 0 ? void 0 : _a.ownerDocument) === null || _b === void 0 ? void 0 : _b.defaultView; return !!(scope && obj instanceof scope.Element); }; var isReplacedElement = function(target) { switch (target.tagName) { case "INPUT": if (target.type !== "image") { break; } case "VIDEO": case "AUDIO": case "EMBED": case "OBJECT": case "CANVAS": case "IFRAME": case "IMG": return true; } return false; }; var global = typeof window !== "undefined" ? window : {}; var cache2 = /* @__PURE__ */ new WeakMap(); var scrollRegexp = /auto|scroll/; var verticalRegexp = /^tb|vertical/; var IE = /msie|trident/i.test(global.navigator && global.navigator.userAgent); var parseDimension = function(pixel) { return parseFloat(pixel || "0"); }; var size = function(inlineSize, blockSize, switchSizes) { if (inlineSize === void 0) { inlineSize = 0; } if (blockSize === void 0) { blockSize = 0; } if (switchSizes === void 0) { switchSizes = false; } return new ResizeObserverSize((switchSizes ? blockSize : inlineSize) || 0, (switchSizes ? inlineSize : blockSize) || 0); }; var zeroBoxes = freeze({ devicePixelContentBoxSize: size(), borderBoxSize: size(), contentBoxSize: size(), contentRect: new DOMRectReadOnly(0, 0, 0, 0) }); var calculateBoxSizes = function(target, forceRecalculation) { if (forceRecalculation === void 0) { forceRecalculation = false; } if (cache2.has(target) && !forceRecalculation) { return cache2.get(target); } if (isHidden(target)) { cache2.set(target, zeroBoxes); return zeroBoxes; } var cs = getComputedStyle(target); var svg = isSVG(target) && target.ownerSVGElement && target.getBBox(); var removePadding = !IE && cs.boxSizing === "border-box"; var switchSizes = verticalRegexp.test(cs.writingMode || ""); var canScrollVertically = !svg && scrollRegexp.test(cs.overflowY || ""); var canScrollHorizontally = !svg && scrollRegexp.test(cs.overflowX || ""); var paddingTop = svg ? 0 : parseDimension(cs.paddingTop); var paddingRight = svg ? 0 : parseDimension(cs.paddingRight); var paddingBottom = svg ? 0 : parseDimension(cs.paddingBottom); var paddingLeft = svg ? 0 : parseDimension(cs.paddingLeft); var borderTop = svg ? 0 : parseDimension(cs.borderTopWidth); var borderRight = svg ? 0 : parseDimension(cs.borderRightWidth); var borderBottom = svg ? 0 : parseDimension(cs.borderBottomWidth); var borderLeft = svg ? 0 : parseDimension(cs.borderLeftWidth); var horizontalPadding = paddingLeft + paddingRight; var verticalPadding = paddingTop + paddingBottom; var horizontalBorderArea = borderLeft + borderRight; var verticalBorderArea = borderTop + borderBottom; var horizontalScrollbarThickness = !canScrollHorizontally ? 0 : target.offsetHeight - verticalBorderArea - target.clientHeight; var verticalScrollbarThickness = !canScrollVertically ? 0 : target.offsetWidth - horizontalBorderArea - target.clientWidth; var widthReduction = removePadding ? horizontalPadding + horizontalBorderArea : 0; var heightReduction = removePadding ? verticalPadding + verticalBorderArea : 0; var contentWidth = svg ? svg.width : parseDimension(cs.width) - widthReduction - verticalScrollbarThickness; var contentHeight = svg ? svg.height : parseDimension(cs.height) - heightReduction - horizontalScrollbarThickness; var borderBoxWidth = contentWidth + horizontalPadding + verticalScrollbarThickness + horizontalBorderArea; var borderBoxHeight = contentHeight + verticalPadding + horizontalScrollbarThickness + verticalBorderArea; var boxes = freeze({ devicePixelContentBoxSize: size(Math.round(contentWidth * devicePixelRatio), Math.round(contentHeight * devicePixelRatio), switchSizes), borderBoxSize: size(borderBoxWidth, borderBoxHeight, switchSizes), contentBoxSize: size(contentWidth, contentHeight, switchSizes), contentRect: new DOMRectReadOnly(paddingLeft, paddingTop, contentWidth, contentHeight) }); cache2.set(target, boxes); return boxes; }; var calculateBoxSize = function(target, observedBox, forceRecalculation) { var _a = calculateBoxSizes(target, forceRecalculation), borderBoxSize = _a.borderBoxSize, contentBoxSize = _a.contentBoxSize, devicePixelContentBoxSize = _a.devicePixelContentBoxSize; switch (observedBox) { case ResizeObserverBoxOptions.DEVICE_PIXEL_CONTENT_BOX: return devicePixelContentBoxSize; case ResizeObserverBoxOptions.BORDER_BOX: return borderBoxSize; default: return contentBoxSize; } }; var ResizeObserverEntry = function() { function ResizeObserverEntry2(target) { var boxes = calculateBoxSizes(target); this.target = target; this.contentRect = boxes.contentRect; this.borderBoxSize = freeze([boxes.borderBoxSize]); this.contentBoxSize = freeze([boxes.contentBoxSize]); this.devicePixelContentBoxSize = freeze([boxes.devicePixelContentBoxSize]); } return ResizeObserverEntry2; }(); var calculateDepthForNode = function(node) { if (isHidden(node)) { return Infinity; } var depth = 0; var parent = node.parentNode; while (parent) { depth += 1; parent = parent.parentNode; } return depth; }; var broadcastActiveObservations = function() { var shallowestDepth = Infinity; var callbacks2 = []; resizeObservers.forEach(function processObserver(ro) { if (ro.activeTargets.length === 0) { return; } var entries = []; ro.activeTargets.forEach(function processTarget(ot) { var entry = new ResizeObserverEntry(ot.target); var targetDepth = calculateDepthForNode(ot.target); entries.push(entry); ot.lastReportedSize = calculateBoxSize(ot.target, ot.observedBox); if (targetDepth < shallowestDepth) { shallowestDepth=t argetDepth; } }); callbacks2.push(function resizeObserverCallback() { ro.callback.call(ro.observer, entries, ro.observer); }); ro.activeTargets.splice(0, ro.activeTargets.length); }); for (var _i=0 , callbacks_1=c allbacks2; _i < callbacks_1.length; _i++) { var callback=c allbacks_1[_i]; callback(); } return shallowestDepth; }; var gatherActiveObservationsAtDepth=f unction(depth) { resizeObservers.forEach(function processObserver(ro) { ro.activeTargets.splice(0, ro.activeTargets.length); ro.skippedTargets.splice(0, ro.skippedTargets.length); ro.observationTargets.forEach(function processTarget(ot) { if (ot.isActive()) { if (calculateDepthForNode(ot.target)> depth) { ro.activeTargets.push(ot); } else { ro.skippedTargets.push(ot); } } }); }); }; var process5 = function() { var depth = 0; gatherActiveObservationsAtDepth(depth); while (hasActiveObservations()) { depth = broadcastActiveObservations(); gatherActiveObservationsAtDepth(depth); } if (hasSkippedObservations()) { deliverResizeLoopError(); } return depth > 0; }; var trigger; var callbacks = []; var notify = function() { return callbacks.splice(0).forEach(function(cb) { return cb(); }); }; var queueMicroTask = function(callback) { if (!trigger) { var toggle_1 = 0; var el_1 = document.createTextNode(""); var config = { characterData: true }; new MutationObserver(function() { return notify(); }).observe(el_1, config); trigger = function() { el_1.textContent = "" + (toggle_1 ? toggle_1-- : toggle_1++); }; } callbacks.push(callback); trigger(); }; var queueResizeObserver = function(cb) { queueMicroTask(function ResizeObserver2() { requestAnimationFrame(cb); }); }; var watching = 0; var isWatching = function() { return !!watching; }; var CATCH_PERIOD = 250; var observerConfig = { attributes: true, characterData: true, childList: true, subtree: true }; var events = [ "resize", "load", "transitionend", "animationend", "animationstart", "animationiteration", "keyup", "keydown", "mouseup", "mousedown", "mouseover", "mouseout", "blur", "focus" ]; var time = function(timeout) { if (timeout === void 0) { timeout = 0; } return Date.now() + timeout; }; var scheduled = false; var Scheduler = function() { function Scheduler2() { var _this = this; this.stopped = true; this.listener = function() { return _this.schedule(); }; } Scheduler2.prototype.run = function(timeout) { var _this = this; if (timeout === void 0) { timeout = CATCH_PERIOD; } if (scheduled) { return; } scheduled = true; var until = time(timeout); queueResizeObserver(function() { var elementsHaveResized = false; try { elementsHaveResized = process5(); } finally { scheduled = false; timeout = until - time(); if (!isWatching()) { return; } if (elementsHaveResized) { _this.run(1e3); } else if (timeout > 0) { _this.run(timeout); } else { _this.start(); } } }); }; Scheduler2.prototype.schedule = function() { this.stop(); this.run(); }; Scheduler2.prototype.observe = function() { var _this = this; var cb = function() { return _this.observer && _this.observer.observe(document.body, observerConfig); }; document.body ? cb() : global.addEventListener("DOMContentLoaded", cb); }; Scheduler2.prototype.start = function() { var _this = this; if (this.stopped) { this.stopped = false; this.observer = new MutationObserver(this.listener); this.observe(); events.forEach(function(name) { return global.addEventListener(name, _this.listener, true); }); } }; Scheduler2.prototype.stop = function() { var _this = this; if (!this.stopped) { this.observer && this.observer.disconnect(); events.forEach(function(name) { return global.removeEventListener(name, _this.listener, true); }); this.stopped = true; } }; return Scheduler2; }(); var scheduler2 = new Scheduler(); var updateCount = function(n) { !watching && n > 0 && scheduler2.start(); watching += n; !watching && scheduler2.stop(); }; var skipNotifyOnElement = function(target) { return !isSVG(target) && !isReplacedElement(target) && getComputedStyle(target).display === "inline"; }; var ResizeObservation = function() { function ResizeObservation2(target, observedBox) { this.target = target; this.observedBox = observedBox || ResizeObserverBoxOptions.CONTENT_BOX; this.lastReportedSize = { inlineSize: 0, blockSize: 0 }; } ResizeObservation2.prototype.isActive = function() { var size2 = calculateBoxSize(this.target, this.observedBox, true); if (skipNotifyOnElement(this.target)) { this.lastReportedSize = size2; } if (this.lastReportedSize.inlineSize !== size2.inlineSize || this.lastReportedSize.blockSize !== size2.blockSize) { return true; } return false; }; return ResizeObservation2; }(); var ResizeObserverDetail = function() { function ResizeObserverDetail2(resizeObserver, callback) { this.activeTargets = []; this.skippedTargets = []; this.observationTargets = []; this.observer = resizeObserver; this.callback = callback; } return ResizeObserverDetail2; }(); var observerMap = /* @__PURE__ */ new WeakMap(); var getObservationIndex = function(observationTargets, target) { for (var i = 0; i < observationTargets.length; i +=1 ) { if (observationTargets[i].target===t arget) { return i; } } return -1; }; var ResizeObserverController=f unction() { function ResizeObserverController2() { } ResizeObserverController2.connect=f unction(resizeObserver, callback) { var detail=n ew ResizeObserverDetail(resizeObserver, callback); observerMap.set(resizeObserver, detail); }; ResizeObserverController2.observe=f unction(resizeObserver, target, options) { var detail=o bserverMap.get(resizeObserver); var firstObservation=d etail.observationTargets.length===0 ; if (getObservationIndex(detail.observationTargets, target) < 0) { firstObservation && resizeObservers.push(detail); detail.observationTargets.push(new ResizeObservation(target, options && options.box)); updateCount(1); scheduler2.schedule(); } }; ResizeObserverController2.unobserve=f unction(resizeObserver, target) { var detail=o bserverMap.get(resizeObserver); var index=g etObservationIndex(detail.observationTargets, target); var lastObservation=d etail.observationTargets.length===1 ; if (index>= 0) { lastObservation && resizeObservers.splice(resizeObservers.indexOf(detail), 1); detail.observationTargets.splice(index, 1); updateCount(-1); } }; ResizeObserverController2.disconnect = function(resizeObserver) { var _this = this; var detail = observerMap.get(resizeObserver); detail.observationTargets.slice().forEach(function(ot) { return _this.unobserve(resizeObserver, ot.target); }); detail.activeTargets.splice(0, detail.activeTargets.length); }; return ResizeObserverController2; }(); var ResizeObserver = function() { function ResizeObserver2(callback) { if (arguments.length === 0) { throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present."); } if (typeof callback !== "function") { throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function."); } ResizeObserverController.connect(this, callback); } ResizeObserver2.prototype.observe = function(target, options) { if (arguments.length === 0) { throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present."); } if (!isElement(target)) { throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element"); } ResizeObserverController.observe(this, target, options); }; ResizeObserver2.prototype.unobserve = function(target) { if (arguments.length === 0) { throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present."); } if (!isElement(target)) { throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element"); } ResizeObserverController.unobserve(this, target); }; ResizeObserver2.prototype.disconnect = function() { ResizeObserverController.disconnect(this); }; ResizeObserver2.toString = function() { return "function ResizeObserver () { [polyfill code] }"; }; return ResizeObserver2; }(); exports2.ResizeObserver = ResizeObserver; exports2.ResizeObserverEntry = ResizeObserverEntry; exports2.ResizeObserverSize = ResizeObserverSize; Object.defineProperty(exports2, "__esModule", { value: true }); }); } }); // ../../../node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js var require_react_is_production_min = __commonJS({ "../../../node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js"(exports) { "use strict"; var b = "function" === typeof Symbol && Symbol.for; var c = b ? Symbol.for("react.element") : 60103; var d = b ? Symbol.for("react.portal") : 60106; var e = b ? Symbol.for("react.fragment") : 60107; var f = b ? Symbol.for("react.strict_mode") : 60108; var g = b ? Symbol.for("react.profiler") : 60114; var h = b ? Symbol.for("react.provider") : 60109; var k = b ? Symbol.for("react.context") : 60110; var l = b ? Symbol.for("react.async_mode") : 60111; var m2 = b ? Symbol.for("react.concurrent_mode") : 60111; var n = b ? Symbol.for("react.forward_ref") : 60112; var p = b ? Symbol.for("react.suspense") : 60113; var q = b ? Symbol.for("react.suspense_list") : 60120; var r = b ? Symbol.for("react.memo") : 60115; var t = b ? Symbol.for("react.lazy") : 60116; var v = b ? Symbol.for("react.block") : 60121; var w = b ? Symbol.for("react.fundamental") : 60117; var x = b ? Symbol.for("react.responder") : 60118; var y = b ? Symbol.for("react.scope") : 60119; function z(a) { if ("object" === typeof a && null !== a) { var u = a.$$typeof; switch (u) { case c: switch (a = a.type, a) { case l: case m2: case e: case g: case f: case p: return a; default: switch (a = a && a.$$typeof, a) { case k: case n: case t: case r: case h: return a; default: return u; } } case d: return u; } } } function A(a) { return z(a) === m2; } exports.AsyncMode = l; exports.ConcurrentMode = m2; exports.ContextConsumer = k; exports.ContextProvider = h; exports.Element = c; exports.ForwardRef = n; exports.Fragment = e; exports.Lazy = t; exports.Memo = r; exports.Portal = d; exports.Profiler = g; exports.StrictMode = f; exports.Suspense = p; exports.isAsyncMode = function(a) { return A(a) || z(a) === l; }; exports.isConcurrentMode = A; exports.isContextConsumer = function(a) { return z(a) === k; }; exports.isContextProvider = function(a) { return z(a) === h; }; exports.isElement = function(a) { return "object" === typeof a && null !== a && a.$$typeof === c; }; exports.isForwardRef = function(a) { return z(a) === n; }; exports.isFragment = function(a) { return z(a) === e; }; exports.isLazy = function(a) { return z(a) === t; }; exports.isMemo = function(a) { return z(a) === r; }; exports.isPortal = function(a) { return z(a) === d; }; exports.isProfiler = function(a) { return z(a) === g; }; exports.isStrictMode = function(a) { return z(a) === f; }; exports.isSuspense = function(a) { return z(a) === p; }; exports.isValidElementType = function(a) { return "string" === typeof a || "function" === typeof a || a === e || a === m2 || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v); }; exports.typeOf = z; } }); // ../../../node_modules/hoist-non-react-statics/node_modules/react-is/index.js var require_react_is = __commonJS({ "../../../node_modules/hoist-non-react-statics/node_modules/react-is/index.js"(exports, module) { "use strict"; if (true) { module.exports = require_react_is_production_min(); } else { module.exports = null; } } }); // ../../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js var require_hoist_non_react_statics_cjs = __commonJS({ "../../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js"(exports, module) { "use strict"; var reactIs = require_react_is(); var REACT_STATICS = { childContextTypes: true, contextType: true, contextTypes: true, defaultProps: true, displayName: true, getDefaultProps: true, getDerivedStateFromError: true, getDerivedStateFromProps: true, mixins: true, propTypes: true, type: true }; var KNOWN_STATICS = { name: true, length: true, prototype: true, caller: true, callee: true, arguments: true, arity: true }; var FORWARD_REF_STATICS = { "$$typeof": true, render: true, defaultProps: true, displayName: true, propTypes: true }; var MEMO_STATICS = { "$$typeof": true, compare: true, defaultProps: true, displayName: true, propTypes: true, type: true }; var TYPE_STATICS = {}; TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS; TYPE_STATICS[reactIs.Memo] = MEMO_STATICS; function getStatics(component) { if (reactIs.isMemo(component)) { return MEMO_STATICS; } return TYPE_STATICS[component["$$typeof"]] || REACT_STATICS; } var defineProperty = Object.defineProperty; var getOwnPropertyNames = Object.getOwnPropertyNames; var getOwnPropertySymbols = Object.getOwnPropertySymbols; var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var getPrototypeOf = Object.getPrototypeOf; var objectPrototype = Object.prototype; function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { if (typeof sourceComponent !== "string") { if (objectPrototype) { var inheritedComponent = getPrototypeOf(sourceComponent); if (inheritedComponent && inheritedComponent !== objectPrototype) { hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); } } var keys3 = getOwnPropertyNames(sourceComponent); if (getOwnPropertySymbols) { keys3 = keys3.concat(getOwnPropertySymbols(sourceComponent)); } var targetStatics = getStatics(targetComponent); var sourceStatics = getStatics(sourceComponent); for (var i = 0; i < keys3.length; ++i) { var key7=k eys3[i]; if (!KNOWN_STATICS[key7] && !(blacklist && blacklist[key7]) && !(sourceStatics && sourceStatics[key7]) && !(targetStatics && targetStatics[key7])) { var descriptor=g etOwnPropertyDescriptor(sourceComponent, key7); try { defineProperty(targetComponent, key7, descriptor); } catch (e) { } } } } return targetComponent; } module.exports=h oistNonReactStatics; } }); // ../../../node_modules/archy/index.js var require_archy=_ _commonJS({ "../../../node_modules/archy/index.js"(exports, module) { module.exports=f unction archy2(obj, prefix2, opts) { if (prefix2===v oid 0) prefix2="" ; if (!opts) opts={ }; var chr=f unction(s) { var chars={ "\u2502": "|", "\u2514": "`", "\u251C": "+", "\u2500": "-", "\u252C": "-" }; return opts.unicode===f alse ? chars[s] : s; }; if (typeof obj==="string" ) obj={ label: obj }; var nodes=o bj.nodes || []; var lines=( obj.label || "").split( "\n"); var splitter="\n" + prefix2 + (nodes.length ? chr( "\u2502") : " ") + " "; return prefix2 + lines.join(splitter) + "\n" + nodes.map(function(node, ix) { var last=i x===n odes.length - 1; var more=n ode.nodes && node.nodes.length; var prefix_=p refix2 + (last ? " " : chr( "\u2502")) + " "; return prefix2 + (last ? chr( "\u2514") : chr( "\u251C")) + chr( "\u2500") + (more ? chr( "\u252C") : chr( "\u2500")) + " " + archy2(node, prefix_, opts).slice(prefix2.length + 2); }).join( ""); }; } }); // ../../../node_modules/fontfaceobserver/fontfaceobserver.standalone.js var require_fontfaceobserver_standalone=_ _commonJS({ "../../../node_modules/fontfaceobserver/fontfaceobserver.standalone.js"(exports, module) { (function() { function l(a, b) { document.addEventListener ? a.addEventListener( "scroll", b, false) : a.attachEvent( "scroll", b); } function m2(a) { document.body ? a() : document.addEventListener ? document.addEventListener( "DOMContentLoaded", function c() { document.removeEventListener( "DOMContentLoaded", c); a(); }) : document.attachEvent( "onreadystatechange", function k() { if ( "interactive"==d ocument.readyState || "complete"==d ocument.readyState) document.detachEvent( "onreadystatechange", k), a(); }); } ; function t(a) { this.a=d ocument.createElement( "div"); this.a.setAttribute( "aria-hidden", "true"); this.a.appendChild(document.createTextNode(a)); this.b=d ocument.createElement( "span"); this.c=d ocument.createElement( "span"); this.h=d ocument.createElement( "span"); this.f=d ocument.createElement( "span"); this.g=- 1; this.b.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;" ; this.c.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;" ; this.f.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;" ; this.h.style.cssText="display:inline-block;width:200%;height:200%;font-size:16px;max-width:none;" ; this.b.appendChild(this.h); this.c.appendChild(this.f); this.a.appendChild(this.b); this.a.appendChild(this.c); } function u(a, b) { a.a.style.cssText="max-width:none;min-width:20px;min-height:20px;display:inline-block;overflow:hidden;position:absolute;width:auto;margin:0;padding:0;top:-999px;white-space:nowrap;font-synthesis:none;font:" + b + ";"; } function z(a) { var b=a .a.offsetWidth, c=b + 100; a.f.style.width=c + "px"; a.c.scrollLeft=c ; a.b.scrollLeft=a .b.scrollWidth + 100; return a.g !==b ? (a.g=b , true) : false; } function A(a, b) { function c() { var a2=k ; z(a2) && a2.a.parentNode && b(a2.g); } var k=a ; l(a.b, c); l(a.c, c); z(a); } ; function B(a, b) { var c=b || {}; this.family=a ; this.style=c .style || "normal"; this.weight=c .weight || "normal"; this.stretch=c .stretch || "normal"; } var C=n ull, D=n ull, E=n ull, F=n ull; function G() { if (null===D ) if (J() && /Apple/.test(window.navigator.vendor)) { var a=/ AppleWebKit\/([0-9]+)(?:\.([0-9]+))(?:\.([0-9]+))/.exec(window.navigator.userAgent); D=! !a && 603> parseInt(a[1], 10); } else D = false; return D; } function J() { null === F && (F = !!document.fonts); return F; } function K() { if (null === E) { var a = document.createElement("div"); try { a.style.font = "condensed 100px sans-serif"; } catch (b) { } E = "" !== a.style.font; } return E; } function L(a, b) { return [a.style, a.weight, K() ? a.stretch : "", "100px", b].join(" "); } B.prototype.load = function(a, b) { var c = this, k = a || "BESbswy", r = 0, n = b || 3e3, H = (/* @__PURE__ */ new Date()).getTime(); return new Promise(function(a2, b2) { if (J() && !G()) { var M = new Promise(function(a3, b3) { function e() { (/* @__PURE__ */ new Date()).getTime() - H >= n ? b3(Error("" + n + "ms timeout exceeded")) : document.fonts.load(L(c, '"' + c.family + '"'), k).then(function(c2) { 1 <=c 2.length ? a3() : setTimeout(e, 25); }, b3); } e(); }), N=n ew Promise(function(a3, c2) { r=s etTimeout(function() { c2(Error( "" + n + "ms timeout exceeded")); }, n); }); Promise.race([N, M]).then( function() { clearTimeout(r); a2(c); }, b2 ); } else m2(function() { function v() { var b3; if (b3=- 1 !=f && -1 !=g || -1 !=f && -1 !=h || -1 !=g && -1 !=h ) (b3=f !=g && f !=h && g !=h ) || (null===C && (b3=/ AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent), C=! !b3 && (536> parseInt(b3[1], 10) || 536 === parseInt(b3[1], 10) && 11 >= parseInt(b3[2], 10))), b3 = C && (f == w && g == w && h == w || f == x && g == x && h == x || f == y && g == y && h == y)), b3 = !b3; b3 && (d.parentNode && d.parentNode.removeChild(d), clearTimeout(r), a2(c)); } function I() { if ((/* @__PURE__ */ new Date()).getTime() - H >= n) d.parentNode && d.parentNode.removeChild(d), b2(Error("" + n + "ms timeout exceeded")); else { var a3 = document.hidden; if (true === a3 || void 0 === a3) f = e.a.offsetWidth, g = p.a.offsetWidth, h = q.a.offsetWidth, v(); r = setTimeout(I, 50); } } var e = new t(k), p = new t(k), q = new t(k), f = -1, g = -1, h = -1, w = -1, x = -1, y = -1, d = document.createElement("div"); d.dir = "ltr"; u(e, L(c, "sans-serif")); u(p, L(c, "serif")); u(q, L(c, "monospace")); d.appendChild(e.a); d.appendChild(p.a); d.appendChild(q.a); document.body.appendChild(d); w = e.a.offsetWidth; x = p.a.offsetWidth; y = q.a.offsetWidth; I(); A(e, function(a3) { f = a3; v(); }); u( e, L(c, '"' + c.family + '",sans-serif') ); A(p, function(a3) { g = a3; v(); }); u(p, L(c, '"' + c.family + '",serif')); A(q, function(a3) { h = a3; v(); }); u(q, L(c, '"' + c.family + '",monospace')); }); }); }; "object" === typeof module ? module.exports = B : (window.FontFaceObserver = B, window.FontFaceObserver.prototype.load = B.prototype.load); })(); } }); // ../../router/build/ErrorBoundary.js import { Component } from "react"; // ../../router/build/renderPage.js import React from "react"; function renderPage(Page4, defaultPageStyle) { const style = { style: defaultPageStyle }; return React.isValidElement(Page4) ? React.cloneElement(Page4, style) : React.createElement(Page4, style); } // ../../router/build/ErrorBoundary.js var NotFoundError = class extends Error { }; var ErrorBoundaryCaughtError = class extends Error { }; var ErrorBoundary = class extends Component { constructor(props) { super(props); this.state = { error: void 0, forceUpdateKey: props.forceUpdateKey }; } static getDerivedStateFromError(error) { return { error }; } /** Resets the error when forceUpdateKey gets bumped. */ static getDerivedStateFromProps(nextProps, prevState) { if (nextProps.forceUpdateKey !== prevState.forceUpdateKey) { const newState = { forceUpdateKey: nextProps.forceUpdateKey }; if (prevState.error) { newState.error = void 0; } return newState; } return null; } render() { if (this.state.error === void 0) { return this.props.children; } if (!(this.state.error instanceof NotFoundError)) { const error = new ErrorBoundaryCaughtError(); error.cause = this.state.error; throw error; } const { notFoundPage, defaultPageStyle } = this.props; if (!notFoundPage) { throw this.state.error; } return renderPage(notFoundPage, defaultPageStyle); } }; // ../../router/build/Router.js import { jsx as _jsx5, jsxs as _jsxs } from "react/jsx-runtime"; import React9, { startTransition } from "react"; // ../../router/build/pathVariables.js var pathVariablesRegExpRaw = ":([a-z]\\w*)"; var pathVariablesRegExp = /* @__PURE__ */ new RegExp(pathVariablesRegExpRaw, "gi"); // ../../router/build/fillPathVariables.js function fillPathVariables(path, variables) { return path.replace(pathVariablesRegExp, (match, name) => { const value = variables[name]; if (typeof value !== "string" || value.length === 0) return match; return encodeURIComponent(value); }); } // ../../router/build/history.js import React4, { useCallback as useCallback2 } from "react"; // ../../router/build/computeRelativePath.js function computeRelativePath(from, to) { if (!from.startsWith("/") || !to.startsWith("/")) { throw new Error("from/to paths are expected to be absolute"); } const [fromDir] = getDirAndFile(from); const [toDir, toFile] = getDirAndFile(to); let relativePath = relative(fromDir, toDir); if (relativePath === "") relativePath = "."; if (!relativePath.startsWith(".") && !relativePath.startsWith("/")) { relativePath = "./" + relativePath; } return relativePath + "/" + toFile; } function getDirAndFile(path) { const index = path.lastIndexOf("/"); return [path.substring(0, index + 1), path.substring(index + 1)]; } var CHAR_DOT = 46; var CHAR_FORWARD_SLASH = 47; var StringPrototypeCharCodeAt = (str, index) => str.charCodeAt(index); var StringPrototypeLastIndexOf = (str, searchString) => str.lastIndexOf(searchString); var StringPrototypeSlice = (str, start, end) => str.slice(start, end); function relative(from, to) { if (from === to) return ""; from = "/" + normalizeString(from); to = "/" + normalizeString(to); if (from === to) return ""; const fromStart = 1; const fromEnd = from.length; const fromLen = fromEnd - fromStart; const toStart = 1; const toLen = to.length - toStart; const length = fromLen < toLen ? fromLen : toLen; let lastCommonSep=- 1; let i=0 ; for (; i < length; i++) { const fromCode=S tringPrototypeCharCodeAt(from, fromStart + i); if (fromCode !==S tringPrototypeCharCodeAt(to, toStart + i)) break; else if (fromCode===C HAR_FORWARD_SLASH) lastCommonSep=i ; } if (i===l ength) { if (toLen> length) { if (StringPrototypeCharCodeAt(to, toStart + i) === CHAR_FORWARD_SLASH) { return StringPrototypeSlice(to, toStart + i + 1); } if (i === 0) { return StringPrototypeSlice(to, toStart + i); } } else if (fromLen > length) { if (StringPrototypeCharCodeAt(from, fromStart + i) === CHAR_FORWARD_SLASH) { lastCommonSep = i; } else if (i === 0) { lastCommonSep = 0; } } } let out = ""; for (i = fromStart + lastCommonSep + 1; i <=f romEnd; ++i) { if (i===f romEnd || StringPrototypeCharCodeAt(from, i)===C HAR_FORWARD_SLASH) { out +=o ut.length===0 ? ".." : "/.."; } } return `${out}${StringPrototypeSlice(to, toStart + lastCommonSep)}`; } var allowAboveRoot=f alse; var separator="/" ; var isPathSeparator=( code)=> code === CHAR_FORWARD_SLASH; function normalizeString(path) { let res = ""; let lastSegmentLength = 0; let lastSlash = -1; let dots = 0; let code = 0; for (let i = 0; i <=p ath.length; ++i) { if (i < path.length) code=S tringPrototypeCharCodeAt(path, i); else if (isPathSeparator(code)) break; else code=C HAR_FORWARD_SLASH; if (isPathSeparator(code)) { if (lastSlash===i - 1 || dots===1 ) { } else if (dots===2 ) { if (res.length < 2 || lastSegmentLength !==2 || StringPrototypeCharCodeAt(res, res.length - 1) !==C HAR_DOT || StringPrototypeCharCodeAt(res, res.length - 2) !==C HAR_DOT) { if (res.length> 2) { const lastSlashIndex = StringPrototypeLastIndexOf(res, separator); if (lastSlashIndex === -1) { res = ""; lastSegmentLength = 0; } else { res = StringPrototypeSlice(res, 0, lastSlashIndex); lastSegmentLength = res.length - 1 - StringPrototypeLastIndexOf(res, separator); } lastSlash = i; dots = 0; continue; } else if (res.length !== 0) { res = ""; lastSegmentLength = 0; lastSlash = i; dots = 0; continue; } } if (allowAboveRoot) { res += res.length > 0 ? `${separator}..` : ".."; lastSegmentLength = 2; } } else { if (res.length > 0) res += `${separator}${StringPrototypeSlice(path, lastSlash + 1, i)}`; else res = StringPrototypeSlice(path, lastSlash + 1, i); lastSegmentLength = i - lastSlash - 1; } lastSlash = i; dots = 0; } else if (code === CHAR_DOT && dots !== -1) { ++dots; } else { dots = -1; } } return res; } // ../../router/build/forwardQueryParams.js function forwardCurrentQueryParams(href) { const queryParamsString = typeof window !== "undefined" ? window.location.search : ""; if (!queryParamsString) { return href; } return forwardQueryParams(queryParamsString, href); } function forwardQueryParams(queryParamsString, href) { const startOfHash = href.indexOf("#"); const hrefWithoutHash = startOfHash === -1 ? href : href.substring(0, startOfHash); const hash2 = startOfHash === -1 ? "" : href.substring(startOfHash); const startOfSearch = hrefWithoutHash.indexOf("?"); if (startOfSearch === -1) { return hrefWithoutHash + queryParamsString + hash2; } const currentSearchParams = new URLSearchParams(queryParamsString); const newSearchString = hrefWithoutHash.substring(startOfSearch + 1); const newSearchParams = new URLSearchParams(newSearchString); for (const [key7, value] of currentSearchParams) { if (!newSearchParams.has(key7)) { newSearchParams.append(key7, value); } } return hrefWithoutHash.substring(0, startOfSearch + 1) + newSearchParams.toString() + hash2; } // ../../router/build/utils.js import React2 from "react"; function isObject(value) { return typeof value === "object" && value !== null && !Array.isArray(value); } function isString(value) { return typeof value === "string"; } var preloadKey = "preload"; function isLazyComponentType(componentType) { return typeof componentType === "object" && componentType !== null && !React2.isValidElement(componentType) && preloadKey in componentType; } function lazy(factory) { const LazyComponent = React2.lazy(factory); let factoryPromise; let LoadedComponent; const Component15 = React2.forwardRef(function LazyWithPreload(props, ref) { return React2.createElement(LoadedComponent !== null && LoadedComponent !== void 0 ? LoadedComponent : LazyComponent, ref ? { ref, ...props } : props); }); Component15.preload = () => { if (!factoryPromise) { factoryPromise = factory().then((module) => { LoadedComponent = module.default; return LoadedComponent; }); } return factoryPromise; }; return Component15; } function getRouteElementId(route, hash2) { if (hash2 && route) { if (route.elements && hash2 in route.elements) { return route.elements[hash2]; } else { return hash2; } } return void 0; } function isBot(userAgent) { return /bot|Mediapartners-Google|Google-PageRenderer|yandex|ia_archiver/iu.test(userAgent); } function yieldToMain(isHighPriority) { if ("scheduler" in window) { const options = { priority: isHighPriority ? "user-blocking" : "user-visible" }; if ("yield" in scheduler) return scheduler.yield(options); if ("postTask" in scheduler) return scheduler.postTask(() => { }, options); } if (isHighPriority) { return Promise.resolve(); } return new Promise((resolve) => { setTimeout(resolve, 0); }); } // ../../router/build/getLocalizedNavigationPath.js async function replacePathVariables(path, currentLocale, nextLocale, defaultLocale, collectionId, pathVariables, collectionUtils) { var _a, _b, _c; let resultPath = path; let isMissingInLocale = false; const resultPathVariables = { ...pathVariables }; const matches = Array.from(resultPath.matchAll(pathVariablesRegExp)); const replacements = await Promise.all(matches.map(async (match) => { var _a2; const pathVariableWithDelimiter = match === null || match === void 0 ? void 0 : match[0]; const pathVariableValue = match === null || match === void 0 ? void 0 : match[1]; if (!pathVariableWithDelimiter || !pathVariableValue) { throw new Error("Failed to replace path variables: unexpected regex match group"); } const currentSlug = pathVariables[pathVariableValue]; if (!currentSlug || !isString(currentSlug)) { throw new Error(`No slug found for path variable ${pathVariableValue}`); } const utils = await ((_a2 = collectionUtils === null || collectionUtils === void 0 ? void 0 : collectionUtils[collectionId]) === null || _a2 === void 0 ? void 0 : _a2.call(collectionUtils)); if (!utils || !currentLocale) { return currentSlug; } const recordId = await utils.getRecordIdBySlug(currentSlug, currentLocale); if (!recordId) return currentSlug; const nextSlug = await utils.getSlugByRecordId(recordId, nextLocale); if (!nextSlug) { isMissingInLocale = true; const defaultLocaleSlug = await utils.getSlugByRecordId(recordId, defaultLocale); if (defaultLocaleSlug) { resultPathVariables[pathVariableValue] = defaultLocaleSlug; } return defaultLocaleSlug !== null && defaultLocaleSlug !== void 0 ? defaultLocaleSlug : currentSlug; } resultPathVariables[pathVariableValue] = nextSlug; return nextSlug; })); let lastIndex = 0; let replacedPath = ""; let hasMatch = false; for (let i = 0; i < matches.length; i++) { const match=m atches[i]; const replacement=r eplacements[i]; if (!match || !replacement) continue; replacedPath +=r esultPath.substring(lastIndex, match.index); lastIndex=( (_a=m atch.index) !==n ull && _a !==v oid 0 ? _a : 0) + ((_c=( _b=m atch[0])===n ull || _b===v oid 0 ? void 0 : _b.length) !==n ull && _c !==v oid 0 ? _c : 0); replacedPath +=r eplacements[i]; hasMatch=t rue; } if (hasMatch) { resultPath=r eplacedPath; } return { path: resultPath, pathVariables: resultPathVariables, isMissingInLocale }; } async function getLocalizedNavigationPath({ currentLocale, nextLocale, defaultLocale, route, pathVariables, collectionUtils, preserveQueryParams }) { const { path }=r oute; let result={ path, pathVariables, isMissingInLocale: false }; if (!path) return result; if (pathVariables && route.collectionId) { try { const pathReplacement=a wait replacePathVariables(path, currentLocale, nextLocale, defaultLocale, route.collectionId, pathVariables, collectionUtils); result=p athReplacement; } catch { } } if (nextLocale.slug) { result.path="/" + nextLocale.slug + result.path; } if (preserveQueryParams && result.path) { result.path=f orwardCurrentQueryParams(result.path); } return result; } // ../../router/build/pageEffects/useViewTransition.js import { useCallback, useEffect, useRef } from "react"; // ../../router/build/pageEffects/getPageEffect.js function getPageEffectForRoute(currentRouteId, nextRouteId, { global, routes }) { var _a; return ((_a=r outes[currentRouteId])===n ull || _a===v oid 0 ? void 0 : _a[nextRouteId]) || global; } // ../../router/build/pageEffects/PageEffectsContext.js import { jsx as _jsx } from "react/jsx-runtime"; import React3 from "react"; var defaultSitePageEffects={ global: void 0, routes: {} }; var PageEffectsContext=/ * @__PURE__ */ React3.createContext(defaultSitePageEffects); function PageEffectsProvider({ children, value }) { return _jsx(PageEffectsContext.Provider, { value, children }); } function usePageEffects() { return React3.useContext(PageEffectsContext); } // ../../router/build/pageEffects/cssGeneration/linearEasing.js var step=1 0; var maxDuration=1 e4; function createLinearEasing(generator) { let time=s tep; let state=g enerator.next(0); const keyframes=[ state.value]; while (!state.done && time < maxDuration) { state=g enerator.next(time); keyframes.push(state.value); time +=s tep; } if (keyframes.length===1 ) keyframes.push(state.value); return { easing: `linear(${keyframes.join( ",")})`, duration: time - step }; } // ../../router/build/pageEffects/cssGeneration/masks.js var cssVariable=( name)=> `--view-transition-${name}`; function parseUnit(value) { return [parseFloat(value), value.endsWith("px") ? "px" : "%"]; } function calcMaskPosition(mask) { const { innerWidth, innerHeight } = window; const [x, xUnit] = parseUnit(mask.x); const [y, yUnit] = parseUnit(mask.y); return { x: xUnit === "px" ? x : innerWidth * (x / 100), y: yUnit === "px" ? y : innerHeight * (y / 100) }; } var conic = { makeKeyframe: (mask, progress2, page) => { let percentage = 0; if (page === "exit" && mask.angularDirection === "clockwise" && progress2 === "start" || page === "exit" && mask.angularDirection === "counter-clockwise" && progress2 === "end" || page === "enter" && mask.angularDirection === "counter-clockwise" && progress2 === "start" || page === "enter" && mask.angularDirection === "clockwise" && progress2 === "end") { percentage = mask.sweepAngle / 360 * 100; } return `${cssVariable("conic-offset")}: ${percentage}%;`; }, makeStyles: (mask, page) => { const offsetToken = `var(${cssVariable("conic-offset")})`; const isTransparentToBlack = page === "exit" && mask.angularDirection === "clockwise" || page === "enter" && mask.angularDirection === "counter-clockwise"; const firstColor = isTransparentToBlack ? "transparent" : "black"; const secondColor = isTransparentToBlack ? "black" : "transparent"; let gradient = `conic-gradient(from `; gradient += `${mask.angle}deg at ${mask.x} ${mask.y}, `; gradient += `${firstColor} 0%, ${firstColor} ${offsetToken}, `; gradient += `${secondColor} ${offsetToken}, ${secondColor} 100%)`; return `mask-image: ${gradient}; -webkit-mask-image: ${gradient};`; }, makePropertyRules: () => ` @property ${cssVariable("conic-offset")} { syntax: ' '; initial-value: 0%; inherits: false; } ` }; var circle = { makeKeyframe: (mask, progress2) => { const { x, y } = calcMaskPosition(mask); if (progress2 === "start") { return `clip-path: circle(0 at ${x}px ${y}px);`; } else { const endRadius = Math.hypot(Math.max(x, window.innerWidth - x), Math.max(y, window.innerHeight - y)); return `clip-path: circle(${endRadius}px at ${x}px ${y}px);`; } } }; var inset = { makeKeyframe: (mask, progress2) => { const { x, y } = calcMaskPosition(mask); const bottom = window.innerHeight - y; const right = window.innerWidth - x; return progress2 === "start" ? `clip-path: inset(${y}px ${right}px ${bottom}px ${x}px round ${mask.round}px);` : `clip-path: inset(0 round 0);`; } }; var blinds = { makeKeyframe: (mask, progress2, page) => { const [, unit] = parseUnit(mask.width); let width = `0${unit}`; if (progress2 === "start" && page === "exit" || progress2 === "end" && page === "enter") { width = mask.width; } return `${cssVariable("blinds-width")}: ${width};`; }, makeStyles: (mask, page) => { const widthToken = `var(${cssVariable("blinds-width")})`; const firstColor = page === "exit" ? "transparent" : "black"; const secondColor = page === "exit" ? "black" : "transparent"; let gradient = `repeating-linear-gradient(`; gradient += mask.angle + 90 + "deg, "; gradient += `${firstColor} 0px, ${firstColor} ${widthToken}, `; gradient += `${secondColor} ${widthToken}, ${secondColor} ${mask.width})`; return `mask-image: ${gradient}; -webkit-mask-image: ${gradient};`; }, makePropertyRules: () => { return ` @property ${cssVariable("blinds-width")} { syntax: ' '; initial-value: 0px; inherits: false; } `; } }; var wipe = { makeKeyframe: (_mask, progress2, page) => { const offset = progress2 === "start" && page === "exit" || progress2 === "end" && page === "enter" ? 1 : 0; return `${cssVariable("wipe-offset")}: ${offset};`; }, makeStyles: (mask, page) => { const offsetToken = `var(${cssVariable("wipe-offset")})`; const firstColor = page === "exit" ? "transparent" : "black"; const secondColor = page === "exit" ? "black" : "transparent"; let gradient = `linear-gradient(`; gradient += mask.angle + 90 + "deg, "; gradient += `${firstColor} calc(calc(0% - ${mask.width}) + calc(calc(100% + ${mask.width}) * ${offsetToken})), `; gradient += `${secondColor} calc(calc(100% + ${mask.width}) * ${offsetToken}))`; return `mask-image: ${gradient}; -webkit-mask-image: ${gradient};`; }, makePropertyRules: () => { return ` @property ${cssVariable("wipe-offset")} { syntax: ' '; initial-value: 0; inherits: false; } `; } }; var maskGenerators = { circle, conic, inset, blinds, wipe }; // ../../router/build/pageEffects/cssGeneration/page.js var restState = { opacity: 1, x: "0px", y: "0px", scale: 1, rotate: 0, rotateX: 0, rotateY: 0, mask: void 0 }; function valuesToCSSKeyframes(values, progress2, page, maskGenerator) { var _a; let keyframes = ` opacity: ${values.opacity}; transform: translate(${values.x}, ${values.y}) scale(${values.scale}) rotateX(${values.rotateX}deg) rotateY(${values.rotateY}deg) rotateZ(${values.rotate}deg); `; if (values.mask) { keyframes += ((_a = maskGenerator === null || maskGenerator === void 0 ? void 0 : maskGenerator.makeKeyframe) === null || _a === void 0 ? void 0 : _a.call(maskGenerator, values.mask, progress2, page)) || ""; } return keyframes; } function getMaskGenerator(type) { return type ? maskGenerators[type] : void 0; } function createPageTransitionRules(page, { transition, ...values }) { var _a; const name = "view-transition-" + page; const settings = { duration: "0s", easing: "linear" }; if (transition.type === "tween") { settings.duration = transition.duration + "s"; settings.easing = `cubic-bezier(${transition.ease.join(",")})`; } else if (transition.type === "spring") { const { easing, duration } = createLinearEasing(spring({ keyframes: [0, 1], stiffness: transition.stiffness, damping: transition.damping, mass: transition.mass, restDelta: 1e-3, restSpeed: 1e-4 })); settings.duration = duration + "ms"; settings.easing = easing; } const maskGenerator = getMaskGenerator((_a = values === null || values === void 0 ? void 0 : values.mask) === null || _a === void 0 ? void 0 : _a.type); let startKeyframes = valuesToCSSKeyframes(values, "start", page, maskGenerator); let endKeyframes = valuesToCSSKeyframes({ ...restState, mask: values.mask }, "end", page, maskGenerator); if (page === "exit") { ; [startKeyframes, endKeyframes] = [endKeyframes, startKeyframes]; } return ` ${values.mask && (maskGenerator === null || maskGenerator === void 0 ? void 0 : maskGenerator.makePropertyRules) ? maskGenerator.makePropertyRules(values.mask) : ""} @keyframes ${name} { 0% { ${startKeyframes} } 100% { ${endKeyframes} } } ::view-transition-${page === "enter" ? "new" : "old"}(root) { animation-name: ${name}; animation-duration: ${settings.duration}; animation-delay: ${transition.delay}s; animation-timing-function: ${settings.easing}; animation-fill-mode: both; ${values.mask && (maskGenerator === null || maskGenerator === void 0 ? void 0 : maskGenerator.makeStyles) ? maskGenerator.makeStyles(values.mask, page) : ""} } `; } // ../../router/build/pageEffects/cssGeneration/index.js var VIEW_TRANSITION_STYLES_ID = "view-transition-styles"; var defaultPageTransition = { x: "0px", y: "0px", scale: 1, opacity: 1, rotate3d: false, rotate: 0, rotateX: 0, rotateY: 0, mask: void 0, transition: { type: "tween", delay: 0, duration: 0.2, ease: [0.27, 0, 0.51, 1], stiffness: 400, damping: 30, mass: 1 } }; function createViewTransitionStylesheet({ exit = defaultPageTransition, enter }) { const styleElement = document.createElement("style"); styleElement.id = VIEW_TRANSITION_STYLES_ID; let styleContent = ` @media (prefers-reduced-motion) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } } `; const disableMixPlusLighter = exit.mask || enter.mask || exit.opacity || enter.opacity || exit.transition.delay || enter.transition.delay; if (disableMixPlusLighter) { styleContent += ` ::view-transition-old(*), ::view-transition-new(*) { mix-blend-mode: normal; } `; } styleContent += ` ::view-transition-old(*), ::view-transition-new(*) { backface-visibility: hidden; } `; styleContent += createPageTransitionRules("exit", exit); styleContent += createPageTransitionRules("enter", enter); styleElement.textContent = styleContent; document.head.appendChild(styleElement); } function removeViewTransitionStylesheet() { frame.render(() => { const element = document.getElementById(VIEW_TRANSITION_STYLES_ID); if (element) { document.head.removeChild(element); } }); } // ../../router/build/pageEffects/viewTransition.js function supportsViewTransitions() { return Boolean(document.startViewTransition); } function startViewTransition(updateView, effect) { if (!supportsViewTransitions()) { return void updateView(); } createViewTransitionStylesheet(effect); const transition = document.startViewTransition(updateView); Promise.all([transition.ready, transition.finished]).then(removeViewTransitionStylesheet).catch(() => { }); return transition; } // ../../router/build/pageEffects/useViewTransition.js function useViewTransition() { const sitePageEffects = usePageEffects(); const resolveHasPainted = useRef(void 0); useEffect(() => { if (resolveHasPainted.current) { resolveHasPainted.current(); resolveHasPainted.current = void 0; } }); return useCallback((currentRouteId, nextRouteId, update) => { const pageEffect = getPageEffectForRoute(currentRouteId, nextRouteId, sitePageEffects); if (pageEffect) { const hasPainted = new Promise((resolve) => { resolveHasPainted.current = resolve; }); const asyncUpdate = async () => { update(); await hasPainted; }; return startViewTransition(asyncUpdate, pageEffect); } else { return update(); } }, [sitePageEffects]); } // ../../router/build/history.js function pushRouteState(routeId, route, { currentRoutePath, currentPathVariables, hash: hash2, pathVariables, localeId, preserveQueryParams }) { const { path } = route; if (!path) return; try { const newPath = getPathForRoute(route, { currentRoutePath, currentPathVariables, hash: hash2, pathVariables, preserveQueryParams }); pushHistoryState({ routeId, hash: hash2, pathVariables, localeId }, newPath); } catch { } } function isHistoryState(data2) { const routeIdKey = "routeId"; return isObject(data2) && isString(data2[routeIdKey]); } function replaceHistoryState(data2, url) { window.history.replaceState( data2, // Second arg is unused and exists for historical purposes only // https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState#unused "", url ); } function pushHistoryState(data2, url) { window.history.pushState( data2, // Second arg is unused and exists for historical purposes only // https://developer.mozilla.org/en-US/docs/Web/API/History/pushState#unused "", url ); } function useReplaceInitialState({ disabled, routeId, initialPathVariables, initialLocaleId }) { React4.useLayoutEffect(() => { if (disabled) return; replaceHistoryState({ routeId, pathVariables: initialPathVariables, localeId: initialLocaleId }); }, []); } function usePopStateHandler(currentRouteId, setCurrentRouteId) { const startViewTransition2 = useViewTransition(); const viewTransitionReady = React4.useRef(void 0); const popStateHandler = React4.useCallback(({ state }) => { var _a, _b, _c; if (!isObject(state)) return; const { routeId, hash: hash2, pathVariables, localeId } = state; if (!isString(routeId)) return; const changeRoute = () => { setCurrentRouteId(routeId, isString(localeId) ? localeId : void 0, isString(hash2) ? hash2 : void 0, isObject(pathVariables) ? pathVariables : void 0, false, true); }; const transition = startViewTransition2(currentRouteId.current, routeId, changeRoute); if (transition) { void transition.updateCallbackDone.then((_a = viewTransitionReady.current) === null || _a === void 0 ? void 0 : _a.resolve).catch((_b = viewTransitionReady.current) === null || _b === void 0 ? void 0 : _b.reject); } else { (_c = viewTransitionReady.current) === null || _c === void 0 ? void 0 : _c.resolve(); } }, [currentRouteId, setCurrentRouteId, startViewTransition2]); const traversalHandler = useCallback2((event) => { if (event.navigationType !== "traverse") return; event.intercept({ async handler() { await new Promise((resolve, reject) => { viewTransitionReady.current = { resolve, reject }; }); }, scroll: "after-transition" }); }, []); React4.useEffect(() => { var _a; window.addEventListener("popstate", popStateHandler); (_a = window.navigation) === null || _a === void 0 ? void 0 : _a.addEventListener("navigate", traversalHandler); return () => { var _a2; window.removeEventListener("popstate", popStateHandler); (_a2 = window.navigation) === null || _a2 === void 0 ? void 0 : _a2.removeEventListener("navigate", traversalHandler); }; }, [popStateHandler, traversalHandler]); } function getHashForRoute(hash2, route, hashVariables) { const resolvedHash = getRouteElementId(route, hash2); if (!resolvedHash) return void 0; const variables = Object.assign({}, route === null || route === void 0 ? void 0 : route.elements, hashVariables); return resolvedHash.replace(pathVariablesRegExp, (m2, p1) => { var _a; return String((_a = variables[p1]) !== null && _a !== void 0 ? _a : m2); }); } function getPathForRoute(route, { currentRoutePath, currentPathVariables, hash: hash2, pathVariables, hashVariables, relative: relative2 = true, preserveQueryParams }) { var _a; let currentPath = currentRoutePath !== null && currentRoutePath !== void 0 ? currentRoutePath : "/"; if (currentPathVariables) { currentPath = currentPath.replace(pathVariablesRegExp, (m2, p1) => String(currentPathVariables[p1] || m2)); } const targetPath = (_a = route === null || route === void 0 ? void 0 : route.path) !== null && _a !== void 0 ? _a : "/"; let path = targetPath; if (pathVariables) { path = path.replace(pathVariablesRegExp, (m2, p1) => String(pathVariables[p1] || m2)); } const resolvedHash = getHashForRoute(hash2, route, hashVariables); const isSamePageHashNavigation = currentPath === path && resolvedHash; if (relative2) { path = computeRelativePath(currentPath, path); } if (preserveQueryParams || isSamePageHashNavigation) { path = forwardCurrentQueryParams(path); } if (resolvedHash) { path = `${path}#${resolvedHash}`; } return path; } async function handleRedirectForMissingSlugs(route, pathVariables, nextLocale) { if (!route.path) return false; if (!pathVariables) return false; const prefix2 = nextLocale.slug ? `/${nextLocale.slug}` : ""; const nextLocaleWithDefaultSlugPath = `${prefix2}${fillPathVariables(route.path, pathVariables)}`; const response = await fetch(nextLocaleWithDefaultSlugPath, { method: "HEAD", redirect: "manual" }); const isRedirect = response.type === "opaqueredirect"; if (isRedirect) { window.location.href = window.location.origin + nextLocaleWithDefaultSlugPath; return true; } return false; } async function switchLocale(options) { const result = await getLocalizedNavigationPath(options); if (!result) return; try { localStorage.setItem("preferredLocale", options.nextLocale.code); } catch (error) { } try { if (typeof result.path !== "string") { throw new Error("Expected result.path to be a string"); } if (result.isMissingInLocale) { const hasRedirect = await handleRedirectForMissingSlugs(options.route, result.pathVariables, options.nextLocale); if (hasRedirect) return; } pushHistoryState({ routeId: options.routeId, pathVariables: result.pathVariables, localeId: options.nextLocale.id, paginationInfo: window.history.state.paginationInfo }, result.path); } catch { } return result; } function pushLoadMoreHistory(hash2, paginationInfo) { try { const currentHistoryState = window.history.state; if (!isHistoryState(currentHistoryState)) return; const newPaginationInfo = { ...currentHistoryState.paginationInfo, [hash2]: paginationInfo }; replaceHistoryState({ ...currentHistoryState, paginationInfo: newPaginationInfo }); } catch { } } // ../../router/build/isSamePage.js function isSamePage(a, b) { if (a.routeId !== b.routeId) return false; if (a.pathVariables === b.pathVariables) return true; const aPathVariables = a.pathVariables || {}; const bPathVariables = b.pathVariables || {}; return aPathVariables.length === bPathVariables.length && Object.keys(aPathVariables).every((key7) => aPathVariables[key7] === bPathVariables[key7]); } // ../../router/build/OnHydrationEnd.js import { useEffect as useEffect2, useInsertionEffect, useLayoutEffect } from "react"; // ../../router/build/reactHydrationINPOptimizer.js var eventsToStop = [ "mousedown", "mouseup", "touchcancel", "touchend", "touchstart", "auxclick", "dblclick", "pointercancel", "pointerdown", "pointerup", "dragend", "dragstart", "drop", "compositionend", "compositionstart", "keydown", "keypress", "keyup", "input", "textInput", // Intentionally camelCase "copy", "cut", "paste", "click", "change", "contextmenu", "reset" ]; var stopFn = (event) => { var _a, _b; if (!((_b = (_a = event.target) === null || _a === void 0 ? void 0 : _a.closest) === null || _b === void 0 ? void 0 : _b.call(_a, "#main"))) return; event.stopPropagation(); performance.mark("framer-react-event-handling-prevented"); }; if (typeof window !== "undefined") window.__FRAMER_TURN_OFF_REACT_EVENT_HANDLING__ = function() { if (!eventsToStop) return; const options = { capture: true }; eventsToStop.forEach((event) => document.body.addEventListener(event, stopFn, options)); window.__FRAMER_TURN_OFF_REACT_EVENT_HANDLING__ = void 0; }; function turnOnReactEventHandling() { if (!eventsToStop) return; const options = { capture: true }; eventsToStop.forEach((event) => document.body.removeEventListener(event, stopFn, options)); eventsToStop = void 0; } // ../../router/build/OnHydrationEnd.js function measureSafe(name, start, end) { try { performance.measure(name, start, end); } catch (e) { console.warn(`Could not measure ${name}`, e); } } var hydrationEffectHasRun = false; var hydrationInsertionEffectHasRun = false; var hydrationLayoutEffectHasRun = false; function OnHydrationEnd({ addHydrationMarkers, turnOffEventHandlerHack }) { const hydrationMarkPrefix = "framer-hydration-"; const hydrationStart = `${hydrationMarkPrefix}start`; const hydrationRenderEnd = `${hydrationMarkPrefix}render-end`; const hydrationLayoutEffectsEnd = `${hydrationMarkPrefix}layout-effects-end`; const hydrationEffectsEnd = `${hydrationMarkPrefix}effects-end`; const hydrationFP = `${hydrationMarkPrefix}first-paint`; useInsertionEffect(() => { if (hydrationInsertionEffectHasRun) return; hydrationInsertionEffectHasRun = true; if (addHydrationMarkers) { performance.mark(hydrationRenderEnd); measureSafe(`${hydrationMarkPrefix}render`, hydrationStart, hydrationRenderEnd); } }, []); useLayoutEffect(() => { if (hydrationLayoutEffectHasRun) return; hydrationLayoutEffectHasRun = true; if (addHydrationMarkers) { performance.mark(hydrationLayoutEffectsEnd); measureSafe(`${hydrationMarkPrefix}layout-effects`, hydrationRenderEnd, hydrationLayoutEffectsEnd); } requestAnimationFrame(() => { var _a, _b, _c; const browserRenderStart = `${hydrationMarkPrefix}browser-render-start`; if (addHydrationMarkers) { performance.mark(browserRenderStart); measureSafe(`${hydrationMarkPrefix}uho`, (_b = (_a = performance.getEntriesByName(hydrationEffectsEnd)[0]) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : (_c = performance.getEntriesByName(hydrationLayoutEffectsEnd)[0]) === null || _c === void 0 ? void 0 : _c.name, browserRenderStart); } setTimeout(() => { if (turnOffEventHandlerHack) { turnOnReactEventHandling(); } if (addHydrationMarkers) { performance.mark(hydrationFP); measureSafe(`${hydrationMarkPrefix}time-to-first-paint`, hydrationStart, hydrationFP); measureSafe(`${hydrationMarkPrefix}browser-render`, browserRenderStart, hydrationFP); } }, 0); }); }, []); useEffect2(() => { var _a, _b, _c; if (hydrationEffectHasRun) return; hydrationEffectHasRun = true; if (turnOffEventHandlerHack) { turnOnReactEventHandling(); } if (addHydrationMarkers) { performance.mark(hydrationEffectsEnd); measureSafe(`${hydrationMarkPrefix}effects`, (_b = (_a = performance.getEntriesByName(hydrationFP)[0]) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : (_c = performance.getEntriesByName(hydrationLayoutEffectsEnd)[0]) === null || _c === void 0 ? void 0 : _c.name, hydrationEffectsEnd); } }, []); return null; } // ../../router/build/RouterContext.js import { jsx as _jsx2 } from "react/jsx-runtime"; import React6 from "react"; // ../../router/build/useGetRouteCallback.js import React5 from "react"; function useGetRouteCallback(routes) { return React5.useCallback((routeId) => routes[routeId], [routes]); } // ../../router/build/RouterContext.js var RouterContext = /* @__PURE__ */ (() => React6.createContext({}))(); function RouterAPIProvider({ api, children }) { return _jsx2(RouterContext.Provider, { value: api, children }); } function useRouter() { return React6.useContext(RouterContext); } function RoutesProvider({ routes, children }) { const getRoute = useGetRouteCallback(routes); return _jsx2(RouterContext.Provider, { value: { getRoute }, children }); } // ../../router/build/SuspenseThatPreservesDom.js import { jsx as _jsx4 } from "react/jsx-runtime"; import { Suspense as Suspense2 } from "react"; // ../../router/build/SuspenseErrorBoundary.js import { jsx as _jsx3 } from "react/jsx-runtime"; import { Component as Component2, Suspense } from "react"; var SuspenseErrorBoundary = class extends Component2 { constructor() { super(...arguments); this.state = { error: void 0 }; } static getDerivedStateFromError(error) { console.error("Derived error in SuspenseErrorBoundary", error); return { error }; } componentDidCatch(error, errorInfo) { var _a; console.error("Caught error in SuspenseErrorBoundary", error, errorInfo); (_a = window.__framer_events) === null || _a === void 0 ? void 0 : _a.push([ "published_site_load_recoverable_error", { message: String(error), componentStack: errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.componentStack } ]); } render() { if (this.state.error === void 0) return this.props.children; if (this.state.error instanceof ErrorBoundaryCaughtError) { throw this.state.error.cause; } return _jsx3(Suspense, { children: this.props.fallbackChildren }); } }; // ../../router/build/SuspenseThatPreservesDom.js var suspendPromise = /* @__PURE__ */ (() => typeof window !== "undefined" ? new Promise(() => { }) : null)(); function Suspend() { if (typeof window === "undefined") return null; throw suspendPromise; } function SuspenseThatPreservesDom({ children }) { return _jsx4(SuspenseErrorBoundary, { fallbackChildren: children, children: _jsx4(Suspense2, { fallback: _jsx4(Suspend, {}), children }) }); } // ../../router/build/types.js var defaultLocaleId = "default"; // ../../router/build/useForceUpdate.js import React7 from "react"; function useForceUpdate2() { const [_, setForcedRenderCount] = React7.useState(0); return [_, React7.useCallback(() => setForcedRenderCount((v) => v + 1), [])]; } // ../../router/build/useLocale.js import React8 from "react"; var noopAsync = async () => { }; var defaultLocaleInfo = { activeLocale: null, locales: [], setLocale: noopAsync }; var LocaleInfoContext = /* @__PURE__ */ React8.createContext(defaultLocaleInfo); function useLocaleInfo() { return React8.useContext(LocaleInfoContext); } function useLocalizationInfo() { const { activeLocale, locales, setLocale } = useLocaleInfo(); return { activeLocalization: activeLocale, localizations: locales, setLocalization: setLocale }; } function useLocaleCode() { var _a, _b; return (_b = (_a = useLocaleInfo().activeLocale) === null || _a === void 0 ? void 0 : _a.code) !== null && _b !== void 0 ? _b : "en-US"; } function useLocale() { return useLocaleCode(); } // ../../router/build/useMonitorNextRender.js import { useCallback as useCallback3, useEffect as useEffect3, useRef as useRef2 } from "react"; function useMonitorNextRender(label) { const startLabel = `start-${label}`; const endLabel = `end-${label}`; const resolveHasPainted = useRef2(void 0); useEffect3(() => { if (resolveHasPainted.current) { resolveHasPainted.current(); resolveHasPainted.current = void 0; } }); return useCallback3(() => { const hasPainted = new Promise((resolve) => { resolveHasPainted.current = resolve; }); performance.mark(startLabel); hasPainted.then(() => { performance.mark(endLabel); performance.measure(label, startLabel, endLabel); }).catch(() => { }); }, [label, startLabel, endLabel]); } // ../../router/build/Router.js function updateScrollPosition(hash2, smoothScroll, isHistoryTransition) { const element = hash2 && document.getElementById(hash2); if (element) { scrollElementIntoView(element, smoothScroll); return; } if (isHistoryTransition) return; window.scrollTo(0, 0); } function useScheduleRenderSideEffects(dep) { const actions = React9.useRef([]); React9.useLayoutEffect(() => { var _a; if (!((_a = actions.current) === null || _a === void 0 ? void 0 : _a.length)) return; actions.current.forEach((action) => action()); actions.current = []; }, [dep]); return React9.useCallback((cb) => { actions.current.push(cb); }, []); } function Router({ defaultPageStyle, disableHistory, initialPathVariables, initialRoute, notFoundPage, collectionUtils, routes, initialLocaleId, locales = [], preserveQueryParams = false, enableImproveInpDuringHydration = false, addHydrationMarkers = false }) { useReplaceInitialState({ disabled: disableHistory, routeId: initialRoute, initialPathVariables, initialLocaleId }); const startViewTransition2 = useViewTransition(); const monitorNextRender = useMonitorNextRender("route-change"); const currentRouteRef = React9.useRef(initialRoute); const currentPathVariablesRef = React9.useRef(initialPathVariables); const currentLocaleIdRef = React9.useRef(initialLocaleId); const currentLocaleId = currentLocaleIdRef.current; const activeLocale = React9.useMemo(() => { var _a; return (_a = locales.find(({ id }) => { if (!currentLocaleId) return id === defaultLocaleId; return id === currentLocaleId; })) !== null && _a !== void 0 ? _a : null; }, [currentLocaleId, locales]); const [dep, forceUpdate] = useForceUpdate2(); const localeInfo = React9.useMemo(() => { return { activeLocale, locales, setLocale: async (localeOrLocaleId) => { let localeId; if (isString(localeOrLocaleId)) { localeId = localeOrLocaleId; } else if (isObject(localeOrLocaleId)) { localeId = localeOrLocaleId.id; } const defaultLocale = locales.find(({ id }) => id === defaultLocaleId); const nextLocale = locales.find(({ id }) => id === localeId); if (!nextLocale) return; const currentRouteId2 = currentRouteRef.current; const currentRoute = routes[currentRouteId2]; if (!currentRoute) return; try { const localeResult = await switchLocale({ currentLocale: activeLocale, nextLocale, route: currentRoute, routeId: currentRouteId2, defaultLocale, pathVariables: currentPathVariablesRef.current, collectionUtils, preserveQueryParams }); if (!localeResult) return; currentPathVariablesRef.current = localeResult.pathVariables; currentLocaleIdRef.current = nextLocale.id; startViewTransition2(currentRouteRef.current, currentRouteId2, () => startTransition(forceUpdate)); monitorNextRender(); } catch { } } }; }, [ activeLocale, collectionUtils, forceUpdate, locales, monitorNextRender, preserveQueryParams, routes, startViewTransition2 ]); const scheduleSideEffect = useScheduleRenderSideEffects(dep); const setCurrentRouteId = React9.useCallback((routeId, localeId, hash2, pathVariables, smoothScroll = false, isHistoryTransition = false) => { currentRouteRef.current = routeId; currentPathVariablesRef.current = pathVariables; currentLocaleIdRef.current = localeId; scheduleSideEffect(() => { updateScrollPosition(hash2, smoothScroll, isHistoryTransition); }); startTransition(forceUpdate); monitorNextRender(); }, [forceUpdate, monitorNextRender, scheduleSideEffect]); usePopStateHandler(currentRouteRef, setCurrentRouteId); const navigate = React9.useCallback((routeId, hash2, pathVariables, smoothScroll) => { var _a, _b; const newRoute = routes[routeId]; if (pathVariables) { const inUse = /* @__PURE__ */ new Set(); const path = (_a = newRoute === null || newRoute === void 0 ? void 0 : newRoute.path) !== null && _a !== void 0 ? _a : "/"; for (const match of path.matchAll(pathVariablesRegExp)) { const usedVariable = match[1]; if (usedVariable === void 0) { throw new Error("A matching path variable should not be undefined"); } inUse.add(usedVariable); } pathVariables = Object.fromEntries(Object.entries(pathVariables).filter(([key7]) => inUse.has(key7))); } const routeElementId = getRouteElementId(newRoute, hash2); if (isSamePage({ routeId: currentRouteRef.current, pathVariables: currentPathVariablesRef.current }, { routeId, pathVariables })) { if (((_b = window.history.state) === null || _b === void 0 ? void 0 : _b.hash) !== hash2) { if (!disableHistory) { const route = routes[routeId]; if (route) { pushRouteState(routeId, route, { currentRoutePath: route.path, currentPathVariables: currentPathVariablesRef.current, pathVariables, hash: hash2, localeId: currentLocaleIdRef.current, preserveQueryParams }); } } } updateScrollPosition(routeElementId, smoothScroll, false); return; } if (!newRoute) return; if (!disableHistory) { const currentRoute = routes[currentRouteRef.current]; pushRouteState(routeId, newRoute, { currentRoutePath: currentRoute === null || currentRoute === void 0 ? void 0 : currentRoute.path, currentPathVariables: currentPathVariablesRef.current, hash: hash2, pathVariables, localeId: currentLocaleIdRef.current, preserveQueryParams }); } const changeRoute = () => setCurrentRouteId(routeId, currentLocaleIdRef.current, routeElementId, pathVariables, smoothScroll, false); startViewTransition2(currentRouteRef.current, routeId, changeRoute); }, [routes, disableHistory, setCurrentRouteId, startViewTransition2, preserveQueryParams]); const getRoute = useGetRouteCallback(routes); const currentRouteId = currentRouteRef.current; const currentPathVariables = currentPathVariablesRef.current; const api = React9.useMemo(() => ({ navigate, getRoute, currentRouteId, currentPathVariables, routes, collectionUtils, preserveQueryParams }), [navigate, getRoute, currentRouteId, currentPathVariables, routes, collectionUtils, preserveQueryParams]); const current = routes[currentRouteRef.current]; if (!current) { throw new Error(`Router cannot find route for ${currentRouteRef.current}`); } const pageExistsInCurrentLocale = !activeLocale || !current.includedLocales || current.includedLocales.includes(activeLocale.id); const pathWithFilledVariables = current.path && currentPathVariables ? fillPathVariables(current.path, currentPathVariables) : current.path; const remountKey = String(currentLocaleId) + pathWithFilledVariables; return _jsx5(RouterAPIProvider, { api, children: _jsx5(LocaleInfoContext.Provider, { value: localeInfo, children: _jsxs(SuspenseThatPreservesDom, { children: [_jsx5(ErrorBoundary, { notFoundPage, defaultPageStyle, forceUpdateKey: dep, children: _jsx5(React9.Fragment, { children: pageExistsInCurrentLocale ? renderPage(current.page, defaultPageStyle) : notFoundPage && renderPage(notFoundPage, defaultPageStyle) }, remountKey) }), _jsx5(OnHydrationEnd, { addHydrationMarkers, turnOffEventHandlerHack: enableImproveInpDuringHydration })] }) }) }); } function scrollElementIntoView(element, smoothScroll) { const scrollIntoViewOptions = smoothScroll ? { behavior: "smooth", block: "start", inline: "nearest" } : void 0; element.scrollIntoView(scrollIntoViewOptions); } // ../../router/build/inferInitialRouteFromPath.js var memoPathRoutes; var memoPaths; var lastRoutes; function getRouteInfoMemo(routes) { if (lastRoutes !== routes) { memoPathRoutes = {}; for (const [routeId, { path }] of Object.entries(routes)) { if (path) memoPathRoutes[path] = { path, depth: pathDepth(path), routeId }; } memoPaths = Object.values(memoPathRoutes); memoPaths.sort(({ depth: depth1 }, { depth: depth2 }) => depth2 - depth1); lastRoutes = routes; } return [memoPathRoutes, memoPaths]; } function inferInitialRouteFromPath(routes, decodedLocationPath, fallback = true, locales = []) { const [pathRoutes, paths] = getRouteInfoMemo(routes); let activeLocale; let localeId; let locationPath = decodedLocationPath; if (locales.length > 0) { const firstPathSegment = locationPath.split("/").find(Boolean); if (firstPathSegment) { activeLocale = locales.find(({ slug }) => slug === firstPathSegment); if (activeLocale) { localeId = activeLocale.id; locationPath = locationPath.substring(activeLocale.slug.length + 1); } } if (!localeId) { const defaultLocale = locales.find(({ slug }) => slug === ""); if (defaultLocale) { localeId = defaultLocale.id; } } } const exactMatch = pathRoutes[locationPath]; if (exactMatch) { const match = matchPath(locationPath, exactMatch.path); if (match.isMatch) return { routeId: exactMatch.routeId, localeId, pathVariables: match.pathVariables }; } for (const { path, routeId } of paths) { const match = matchPath(locationPath, path); if (match.isMatch) return { routeId, localeId, pathVariables: match.pathVariables }; } if (!fallback) throw new Error("No exact match found for path"); const rootPath = pathRoutes["/"]; if (rootPath) return { routeId: rootPath.routeId, localeId }; const firstRoute = Object.keys(routes)[0]; if (!firstRoute) throw new Error("Router should not have undefined routes"); return { routeId: firstRoute, localeId }; } function pathDepth(path) { const pathWithTrimmedSlashes = path.replace(/^\/|\/$/gu, ""); if (pathWithTrimmedSlashes === "") return 0; return pathWithTrimmedSlashes.split("/").length; } function matchPath(path, routePath) { const pathVariablesKeys = []; const safeRoutePath = escapeStringRegExp(routePath); const routePathRegExpString = safeRoutePath.replace(pathVariablesRegExp, (_, name) => { pathVariablesKeys.push(name); return "([^/]+)"; }); const routePathRegExp = new RegExp(routePathRegExpString + "$"); const matches = path.match(routePathRegExp); if (!matches) return { isMatch: false }; if (matches.length === 1) return { isMatch: true }; const pathVariables = {}; const pathVariablesValues = matches.slice(1); for (let i = 0; i < pathVariablesKeys.length; ++i) { const key7=p athVariablesKeys[i]; if (key7===v oid 0) continue; const value=p athVariablesValues[i]; const existingValue=p athVariables[key7]; if (existingValue) { if (existingValue !==v alue) { return { isMatch: false }; } else { continue; } } if (value===v oid 0) { throw new Error( "Path variable values cannot be undefined"); } pathVariables[key7]=v alue; } return { isMatch: true, pathVariables }; } function escapeStringRegExp(string) { return string.replace(/[|\\{}()[\]^$+*?.]/gu, "\\$&").replace(/-/gu, "\\x2d"); } // ../../router/build/isRoute.js var key="page" ; function isRoute(route) { return isObject(route) && key in route && route.page !==v oid 0; } // ../../router/build/useCurrentRoute.js import { jsx as _jsx6 } from "react/jsx-runtime"; import React10, { useContext } from "react"; var CurrentRouteContext=/ * @__PURE__ */ (()=> React10.createContext(void 0))(); function useCurrentRoute() { var _a; const router = useRouter(); const override = useContext(CurrentRouteContext); const id = override !== null && override !== void 0 ? override : router.currentRouteId; if (!id) return void 0; const route = (_a = router.getRoute) === null || _a === void 0 ? void 0 : _a.call(router, id); if (!route) return void 0; return { ...route, id, pathVariables: override ? void 0 : router.currentPathVariables }; } function useCurrentRouteId() { var _a; return (_a = useCurrentRoute()) === null || _a === void 0 ? void 0 : _a.id; } // ../../router/build/useCurrentPathVariables.js function useCurrentPathVariables() { var _a; return (_a = useCurrentRoute()) === null || _a === void 0 ? void 0 : _a.pathVariables; } // ../../router/build/useRoute.js function useRoute(routeId) { var _a; const routerAPI = useRouter(); if (!routeId) return void 0; return (_a = routerAPI.getRoute) === null || _a === void 0 ? void 0 : _a.call(routerAPI, routeId); } // ../../router/build/useRouteAnchor.js import React11 from "react"; // ../../router/build/useRoutePreloader.js import { useEffect as useEffect4 } from "react"; var shouldPreloadBasedOnUA = /* @__PURE__ */ (() => typeof window !== "undefined" && !isBot(navigator.userAgent))(); function useRoutePreloader(routeIds, enabled = true) { const { getRoute } = useRouter(); useEffect4(() => { if (!getRoute || !enabled || !shouldPreloadBasedOnUA) return; for (const routeId of routeIds) { void preloadRoute(getRoute(routeId)); } }, [routeIds, getRoute, enabled]); } async function preloadRoute(route) { if (!shouldPreloadBasedOnUA || !route) return; const component = route.page; if (!component || !isLazyComponentType(component)) return; await yieldToMain(); try { await component.preload(); } catch (e) { if (false) console.warn("Preload failed", route, e); } } // ../../router/build/useRouteAnchor.js function useRouteAnchor(routeId, { elementId, hash: linkHash } = {}) { const { navigate, currentPathVariables, preserveQueryParams } = useRouter(); const route = useRoute(routeId); const currentRouteId = useCurrentRouteId(); const currentRoute = useRoute(currentRouteId !== null && currentRouteId !== void 0 ? currentRouteId : ""); useRoutePreloader([routeId], true); const hash2 = linkHash !== null && linkHash !== void 0 ? linkHash : elementId; const href = React11.useMemo(() => getPathForRoute(route, { currentRoutePath: currentRoute === null || currentRoute === void 0 ? void 0 : currentRoute.path, currentPathVariables, hash: hash2, preserveQueryParams }), [currentRoute, currentPathVariables, hash2, preserveQueryParams, route]); const navigateToRoute = React11.useCallback(() => navigate === null || navigate === void 0 ? void 0 : navigate(routeId, hash2), [hash2, navigate, routeId]); const onClick = React11.useCallback((event) => { event.preventDefault(); navigateToRoute(); }, [navigateToRoute]); return { onClick, href }; } // ../../router/build/useRouteElementId.js import React12 from "react"; function useRouteElementId(id, targetRouteId) { var _a; const currentRoute = useCurrentRoute(); const route = (_a = useRoute(targetRouteId)) !== null && _a !== void 0 ? _a : currentRoute; return React12.useMemo(() => { if (!route) return id; return getRouteElementId(route, id); }, [id, route]); } // ../../router/build/useRouteHandler.js import React13 from "react"; function useRouteHandler(routeId, preload = false, elementId) { const { navigate } = useRouter(); useRoutePreloader([routeId], preload); const handler = React13.useCallback(() => navigate === null || navigate === void 0 ? void 0 : navigate(routeId, elementId), [navigate, elementId, routeId]); return handler; } // ../../library/src/utils/warnOnce.ts var warningMessages = /* @__PURE__ */ new Set(); function warnOnce(keyMessage, ...rest) { if (warningMessages.has(keyMessage)) return; warningMessages.add(keyMessage); console.warn(keyMessage, ...rest); } // ../../library/src/utils/deprecation.ts function deprecationWarning(removedItem, removalVersion, replacement) { const replacementText = replacement ? `, use ${replacement} instead` : ""; const warningText = `Deprecation warning: ${removedItem} will be removed in version ${removalVersion}${replacementText}.`; warnOnce(warningText); } // ../../library/src/animation/Animatable/Observers.ts var Observers = class { constructor() { __publicField(this, "observers", /* @__PURE__ */ new Set()); __publicField(this, "transactions", {}); } add(observer) { this.observers.add(observer); let isCalled = false; return () => { if (isCalled) { return; } isCalled = true; this.remove(observer); }; } remove(observer) { this.observers.delete(observer); } notify(change, transaction) { if (transaction) { const accumulatedChange = this.transactions[transaction] || change; accumulatedChange.value = change.value; this.transactions[transaction] = accumulatedChange; } else { this.callObservers(change); } } finishTransaction(transaction) { const accumulatedChange = this.transactions[transaction]; delete this.transactions[transaction]; return this.callObservers(accumulatedChange, transaction); } callObservers(change, transaction) { const finishObservers = []; new Set(this.observers).forEach((observer) => { if (typeof observer === "function") { observer(change, transaction); } else { observer.update(change, transaction); finishObservers.push(observer.finish); } }); return finishObservers; } }; // ../../library/src/animation/Animatable/Animatable.ts var Animatable = /* @__PURE__ */ (() => { function Animatable2(value) { deprecationWarning("Animatable()", "2.0.0", "the new animation API (https://www.framer.com/api/animation/)"); return isAnimatable(value) ? value : new AnimatableValue(value); } Animatable2.transaction = (update) => { const transactionId = Math.random(); const updatedValues = /* @__PURE__ */ new Set(); const updater = (animatable, value) => { animatable.set(value, transactionId); updatedValues.add(animatable); }; update(updater, transactionId); const finishObservers = []; updatedValues.forEach((value) => { finishObservers.push(...value.finishTransaction(transactionId)); }); finishObservers.forEach((finish) => { finish(transactionId); }); }; Animatable2.getNumber = (value, defaultValue = 0) => { return Animatable2.get(value, defaultValue); }; Animatable2.get = (value, defaultValue) => { if (value === void 0 || value === null) { return defaultValue; } if (isAnimatable(value)) { return value.get(); } return value; }; Animatable2.objectToValues = (object) => { if (!object) { return object; } const result = {}; for (const key7 in object) { const value = object[key7]; if (isAnimatable(value)) { result[key7] = value.get(); } else { result[key7] = value; } } return result; }; return Animatable2; })(); var onUpdateKey = "onUpdate"; var finishTransactionKey = "finishTransaction"; function isAnimatable(value) { return value !== null && typeof value === "object" && onUpdateKey in value && value[onUpdateKey] instanceof Function && finishTransactionKey in value && value[finishTransactionKey] instanceof Function; } function animatableInterpolation(value, currentInterpolation) { return { interpolate(from, to) { const fromValue = from.get(); const toValue = to.get(); const result = Animatable(fromValue); return (progress2) => { const v = currentInterpolation.interpolate(fromValue, toValue)(progress2); result.set(v); return result; }; }, difference(from, to) { const v = from.get(); return currentInterpolation.difference(v, to.get()); } }; } var AnimatableValue = class { constructor(value) { this.value = value; __publicField(this, "observers", new Observers()); } static interpolationFor(value, currentInterpolation) { if (isAnimatable(value)) { return animatableInterpolation(value, currentInterpolation); } } get() { return this.value; } set(value, transaction) { const oldValue = this.value; if (isAnimatable(value)) { value = value.get(); } this.value = value; const change = { value, oldValue }; this.observers.notify(change, transaction); } finishTransaction(transaction) { return this.observers.finishTransaction(transaction); } onUpdate(handler) { return this.observers.add(handler); } }; // ../../library/src/render/utils/roundedNumber.ts function roundedNumber(value, decimals) { const d = Math.round(Math.abs(decimals)); const multiplier = 10 ** d; return Math.round(value * multiplier) / multiplier; } function roundedNumberString(value, decimals) { const result = value.toFixed(decimals); return decimals === 0 ? result : `${+result}`; } function roundWithOffset(value, offset) { if (offset === 0) { return Math.round(value); } offset -= offset | 0; if (offset < 0) { offset=1 - offset; } return Math.round(value - offset) + offset; } // ../../library/src/render/types/Point.ts function Point(x, y) { return { x, y }; } ((Point2)=> { Point2.add = (...args) => { return args.reduce( (previousValue, currentValue) => { return { x: previousValue.x + currentValue.x, y: previousValue.y + currentValue.y }; }, { x: 0, y: 0 } ); }; Point2.subtract = (a, b) => { return { x: a.x - b.x, y: a.y - b.y }; }; Point2.multiply = (a, b) => { return { x: a.x * b, y: a.y * b }; }; Point2.divide = (a, b) => { return { x: a.x / b, y: a.y / b }; }; Point2.absolute = (point) => { return { x: Math.abs(point.x), y: Math.abs(point.y) }; }; Point2.reverse = (point) => { return { x: point.x * -1, y: point.y * -1 }; }; Point2.pixelAligned = (point, offset = { x: 0, y: 0 }) => { return { x: roundWithOffset(point.x, offset.x), y: roundWithOffset(point.y, offset.y) }; }; Point2.distance = (a, b) => { const deltaX = Math.abs(a.x - b.x); const deltaY = Math.abs(a.y - b.y); return Math.sqrt(deltaX * deltaX + deltaY * deltaY); }; Point2.angle = (a, b) => { return Math.atan2(b.y - a.y, b.x - a.x) * 180 / Math.PI - 90; }; Point2.angleFromX = (a, b) => { return Math.atan2(b.y - a.y, b.x - a.x) * 180 / Math.PI; }; Point2.isEqual = (a, b) => { return a.x === b.x && a.y === b.y; }; Point2.rotationNormalizer = () => { let lastValue; return (value) => { if (typeof lastValue !== "number") { lastValue = value; } const diff = lastValue - value; const maxDiff = Math.abs(diff) + 180; const nTimes = Math.floor(maxDiff / 360); if (diff < 180) { value -=n Times * 360; } if (diff> 180) { value += nTimes * 360; } lastValue = value; return value; }; }; function center(a, b) { return { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 }; } Point2.center = center; function centroid(points) { let sumX = 0; let sumY = 0; points.forEach((point) => { sumX += point.x; sumY += point.y; }); const centroidX = sumX / points.length; const centroidY = sumY / points.length; return { x: centroidX, y: centroidY }; } Point2.centroid = centroid; function sortClockwise(points) { const centerPoint = Point2.centroid(points); const angles = /* @__PURE__ */ new Map(); for (let i = 0; i < points.length; i++) { const point=p oints[i]; angles.set(point, Math.atan2(point.x - centerPoint.x, point.y - centerPoint.y)); } return points.sort((a, b)=> angles.get(a) - angles.get(b)); } Point2.sortClockwise = sortClockwise; })(Point || (Point = {})); // ../../library/src/animation/Animators/BezierAnimator.ts var BezierDefaults = { curve: "ease" /* Ease */, duration: 1 }; function controlPointsForCurve(curve) { switch (curve) { case "linear" /* Linear */: return [0, 0, 1, 1]; case "ease" /* Ease */: return [0.25, 0.1, 0.25, 1]; case "ease-in" /* EaseIn */: return [0.42, 0, 1, 1]; case "ease-out" /* EaseOut */: return [0, 0, 0.58, 1]; case "ease-in-out" /* EaseInOut */: return [0.42, 0, 0.58, 1]; } } var BezierAnimator = class { constructor(options, interpolation) { this.interpolation = interpolation; __publicField(this, "unitBezier"); __publicField(this, "options"); __publicField(this, "current"); __publicField(this, "destination"); __publicField(this, "interpolator"); __publicField(this, "progress", 0); __publicField(this, "next", (delta) => { const { duration } = this.options; this.progress += delta / duration; const value = this.unitBezier.solve(this.progress, this.solveEpsilon(duration)); this.current = this.interpolator(value); return this.current; }); this.options = { ...BezierDefaults, ...options }; let controlPoints; if (typeof this.options.curve === "string") { controlPoints = controlPointsForCurve(this.options.curve); } else { controlPoints = this.options.curve; } const [p1x, p1y, p2x, p2y] = controlPoints; this.unitBezier = new UnitBezier(Point(p1x, p1y), Point(p2x, p2y)); } setFrom(value) { this.current = value; this.updateInterpolator(); } setTo(value) { this.destination = value; this.updateInterpolator(); } isReady() { return this.interpolator !== void 0; } updateInterpolator() { if (this.current === void 0 || this.destination === void 0) { return; } this.interpolator = this.interpolation.interpolate(this.current, this.destination); } isFinished() { return this.progress >= 1; } solveEpsilon(duration) { return 1 / (200 * duration); } }; var UnitBezier = class { constructor(point1, point2) { __publicField(this, "a"); __publicField(this, "b"); __publicField(this, "c"); this.c = Point.multiply(point1, 3); this.b = Point.subtract(Point.multiply(Point.subtract(point2, point1), 3), this.c); this.a = Point.subtract(Point.subtract(Point(1, 1), this.c), this.b); } solve(x, epsilon2) { return this.sampleY(this.solveForT(x, epsilon2)); } sampleX(t) { return ((this.a.x * t + this.b.x) * t + this.c.x) * t; } sampleY(t) { return ((this.a.y * t + this.b.y) * t + this.c.y) * t; } sampleDerivativeX(t) { return (3 * this.a.x * t + 2 * this.b.x) * t + this.c.x; } solveForT(x, epsilon2) { let t0, t1, t2, x2, d2, i; t2 = x; for (i = 0; i < 8; ++i) { x2=t his.sampleX(t2) - x; if (Math.abs(x2) < epsilon2) return t2; d2=t his.sampleDerivativeX(t2); if (Math.abs(d2) < epsilon2) break; t2=t 2 - x2 / d2; } t0=0 ; t1=1 ; t2=x ; if (t2 < t0) return t0; if (t2> t1) return t1; while (t0 < t1) { x2=t his.sampleX(t2); if (Math.abs(x2 - x) < epsilon2) return t2; if (x> x2) t0 = t2; else t1 = t2; t2 = (t1 - t0) * 0.5 + t0; } return t2; } }; // ../../library/src/animation/Animators/Integrator.ts var Integrator = class { constructor(accelerationFunction) { __publicField(this, "accelerationForState"); this.accelerationForState = accelerationFunction; } integrateState(state, dt) { const a = this.evaluateState(state); const b = this.evaluateStateWithDerivative(state, dt * 0.5, a); const c = this.evaluateStateWithDerivative(state, dt * 0.5, b); const d = this.evaluateStateWithDerivative(state, dt, c); const dxdt = 1 / 6 * (a.dx + 2 * (b.dx + c.dx) + d.dx); const dvdt = 1 / 6 * (a.dv + 2 * (b.dv + c.dv) + d.dv); state.x = state.x + dxdt * dt; state.v = state.v + dvdt * dt; return state; } evaluateState(initialState2) { const dv = this.accelerationForState(initialState2); return { dx: initialState2.v, dv }; } evaluateStateWithDerivative(initialState2, dt, derivative) { const state = { x: initialState2.x + derivative.dx * dt, v: initialState2.v + derivative.dv * dt }; const output = { dx: state.v, dv: this.accelerationForState(state) }; return output; } }; // ../../library/src/animation/Animators/FrictionAnimator.ts var FrictionAnimator = class { constructor(options) { __publicField(this, "options"); __publicField(this, "state"); __publicField(this, "integrator"); this.options = { velocity: 0, friction: 2, tolerance: 1 / 10 }; Object.assign(this.options, options); this.state = { x: 0, v: this.options.velocity }; this.integrator = new Integrator((state) => -(this.options.friction * state.v)); } setFrom(value) { this.state.x = value; } setTo(value) { } setVelocity(velocity) { this.state.v = velocity; } getState() { return this.state; } isReady() { return true; } next(delta) { this.state = this.integrator.integrateState(this.state, delta); return this.state.x; } isFinished() { return Math.abs(this.state.v) < this.options.tolerance; } }; // ../../library/src/interpolation/Interpolation.ts function isInterpolatable(value) { return typeof value==="function" && value.interpolationFor && typeof value.interpolationFor==="function" ; } var Interpolation={ /** * @param from - * @param to - * @internal */ handleUndefined: (from, to)=> { if (from === void 0) { from = to; } if (to === void 0) { to = from; } return [from, to]; } }; // ../../library/src/interpolation/NumberInterpolation.ts var NumberInterpolation = { interpolate(from, to) { ; [from, to] = Interpolation.handleUndefined(from, to); const a1 = +from; const b1 = to - a1; return (progress2) => { const value = a1 + b1 * progress2; return value; }; }, difference(from, to) { return to - from; } }; // ../../library/src/animation/Animators/SpringCurveValueConverter.ts var epsilon = 1e-3; var minDuration = 0.01; var maxDuration2 = 10; var minDamping = /* @__PURE__ */ (() => Number.MIN_VALUE)(); var maxDamping = 1; function approximateRoot(func, derivative, initialGuess, times = 12) { let result = initialGuess; for (let i = 1, end = times, asc = 1 <=e nd; asc ? i < end : i> end; asc ? i++ : i--) { result = result - func(result) / derivative(result); } return result; } function angularFrequency(undampedFrequency, dampingRatio) { return undampedFrequency * Math.sqrt(1 - Math.pow(dampingRatio, 2)); } var SpringCurveValueConverter = { computeDampingRatio: (tension, friction, mass = 1) => { return friction / (2 * Math.sqrt(mass * tension)); }, // Tries to compute the duration of a spring, // but can't for certain velocities and if dampingRatio >= 1 // In those cases it will return null computeDuration: (tension, friction, velocity = 0, mass = 1) => { let duration; const dampingRatio = SpringCurveValueConverter.computeDampingRatio(tension, friction); const undampedFrequency = Math.sqrt(tension / mass); if (dampingRatio < 1) { const a=M ath.sqrt(1 - Math.pow(dampingRatio, 2)); const b=v elocity / (a * undampedFrequency); const c=d ampingRatio / a; const d=- ((b - c) / epsilon); if (d <=0 ) { return null; } duration=M ath.log(d) / (dampingRatio * undampedFrequency); } else { return null; } return duration; }, computeDerivedCurveOptions: (dampingRatio, duration, velocity=0 , mass=1 )=> { let derivative, envelope; dampingRatio = Math.max(Math.min(dampingRatio, maxDamping), minDamping); duration = Math.max(Math.min(duration, maxDuration2), minDuration); if (dampingRatio < 1) { envelope=f unction(envelopeUndampedFrequency) { const exponentialDecay=e nvelopeUndampedFrequency * dampingRatio; const currentDisplacement=e xponentialDecay * duration; const a=e xponentialDecay - velocity; const b=a ngularFrequency(envelopeUndampedFrequency, dampingRatio); const c=M ath.exp(-currentDisplacement); return epsilon - a / b * c; }; derivative=f unction(derivativeUndampedFrequency) { const exponentialDecay=d erivativeUndampedFrequency * dampingRatio; const currentDisplacement=e xponentialDecay * duration; const d=c urrentDisplacement * velocity + velocity; const e=M ath.pow(dampingRatio, 2) * Math.pow(derivativeUndampedFrequency, 2) * duration; const f=M ath.exp(-currentDisplacement); const g=a ngularFrequency(Math.pow(derivativeUndampedFrequency, 2), dampingRatio); const factor=- envelope(derivativeUndampedFrequency) + epsilon> 0 ? -1 : 1; return factor * ((d - e) * f) / g; }; } else { envelope = function(envelopeUndampedFrequency) { const a = Math.exp(-envelopeUndampedFrequency * duration); const b = (envelopeUndampedFrequency - velocity) * duration + 1; return -epsilon + a * b; }; derivative = function(derivativeUndampedFrequency) { const a = Math.exp(-derivativeUndampedFrequency * duration); const b = (velocity - derivativeUndampedFrequency) * Math.pow(duration, 2); return a * b; }; } const result = { tension: 100, friction: 10, velocity }; const initialGuess = 5 / duration; const undampedFrequency = approximateRoot(envelope, derivative, initialGuess); if (!isNaN(undampedFrequency)) { result.tension = Math.pow(undampedFrequency, 2) * mass; result.friction = dampingRatio * 2 * Math.sqrt(mass * result.tension); } return result; } }; // ../../library/src/animation/Animators/SpringAnimator.ts var SpringTensionFrictionDefaults = /* @__PURE__ */ (() => ({ tension: 500, friction: 10, tolerance: 1 / 1e4, velocity: 0 }))(); var SpringDampingDurationDefaults = { dampingRatio: 1, duration: 1, velocity: 0, mass: 1 }; function isDampingDurationSpringOptions(options) { if (!options) { return false; } return typeof options.dampingRatio === "number" || typeof options.duration === "number" || typeof options.mass === "number"; } var SpringAnimator = class { constructor(options, interpolation) { this.interpolation = interpolation; __publicField(this, "options"); __publicField(this, "current"); __publicField(this, "destination"); __publicField(this, "difference"); __publicField(this, "state"); __publicField(this, "integrator"); __publicField(this, "interpolator"); let _opt; if (isDampingDurationSpringOptions(options)) { const toPass = { ...SpringDampingDurationDefaults, ...options }; _opt = SpringCurveValueConverter.computeDerivedCurveOptions( toPass.dampingRatio, toPass.duration, toPass.velocity, toPass.mass ); } else { _opt = options; } this.options = { ...SpringTensionFrictionDefaults, ..._opt }; this.state = { x: 0, v: this.options.velocity }; this.integrator = new Integrator((state) => -this.options.tension * state.x - this.options.friction * state.v); } isReady() { return this.interpolator !== void 0 && this.difference !== void 0; } next(delta) { this.state = this.integrator.integrateState(this.state, delta); const value = this.interpolator(this.progress()); return value; } isFinished() { const positionNearZero = Math.abs(this.state.x) < this.options.tolerance; const velocityNearZero=M ath.abs(this.state.v) < this.options.tolerance; return positionNearZero && velocityNearZero; } setFrom(value) { this.current=v alue; this.updateInterpolator(); } setVelocity(velocity) { this.state.v=v elocity; } progress() { return 1 - this.state.x / this.difference; } // The spring always settles to 0, so we create an interpolation to the destination // And calculate the progress based on the current state and the span of the interpolation // This lets us integrate over state.x, even though Value is generic setTo(value) { this.destination=v alue; this.difference=t his.interpolation.difference(this.destination, this.current); this.state.x=t his.difference; this.updateInterpolator(); } /** @internal */ getState() { return this.state; } updateInterpolator() { if (this.current===v oid 0 || this.destination===v oid 0) { return; } this.interpolator=t his.interpolation.interpolate(this.current, this.destination); } }; // ../../library/src/animation/Animators/InertialScrollAnimator.ts var Defaults={ velocity: 0, min: 0, max: 0, momentum: { friction: 2, tolerance: 10 }, bounce: { tension: 500, friction: 10, tolerance: 1 } }; var InertialScrollAnimator=c lass { constructor(options) { __publicField(this, "options"); __publicField(this, "current"); __publicField(this, "frictionAnimator"); __publicField(this, "springAnimator"); __publicField(this, "useSpring"); this.options=O bject.assign({ ...Defaults }, options); this.frictionAnimator=n ew FrictionAnimator({ friction: this.options.momentum.friction, tolerance: this.options.momentum.tolerance, velocity: this.options.velocity }); this.springAnimator=n ew SpringAnimator( { tension: this.options.bounce.tension, friction: this.options.bounce.friction, tolerance: this.options.bounce.tolerance, velocity: this.options.velocity }, NumberInterpolation ); this.useSpring=f alse; } isReady() { return true; } next(delta) { this.current=t his.currentAnimator.next(delta); if (!this.useSpring) { this.tryTransitionToSpring(); } return this.current; } get currentAnimator() { if (this.useSpring) { return this.springAnimator; } return this.frictionAnimator; } isFinished() { return this.currentAnimator.isFinished(); } get state() { return this.currentAnimator.getState(); } setFrom(value) { this.setState({ x: value, v: this.state.v }); } setState(state) { this.frictionAnimator.setFrom(state.x); this.frictionAnimator.setVelocity(state.v); if (this.isValidState()) { return this.tryTransitionToSpring(); } else { let bound=0 ; if (this.state.x <=t his.options.min) { bound=t his.options.min; } if (this.state.x>= this.options.max) { bound = this.options.max; } return this.transitionToSpring(bound); } } setTo(destination) { this.frictionAnimator.setTo(destination); this.springAnimator.setTo(destination); } setLimits(min, max) { this.options.min = min; this.options.max = max; } // If the position is outside the min and max bounds, and traveling // further away, then transition from friction to spring animation tryTransitionToSpring() { const belowMinWithVelocity = this.state.x < this.options.min && this.state.v <=0 ; const aboveMaxWithVelocity=t his.state.x> this.options.max && this.state.v >= 0; if (belowMinWithVelocity || aboveMaxWithVelocity) { let bound; if (belowMinWithVelocity) { bound = this.options.min; } else { bound = this.options.max; } this.transitionToSpring(bound); } else { this.useSpring = false; } } transitionToSpring(bound) { this.springAnimator.setFrom(this.state.x); this.springAnimator.setVelocity(this.state.v); this.springAnimator.setTo(bound); this.useSpring = true; } // If the position is outside the min and max bounds, but traveling // back towards the bounds, check if the velocity is sufficient to // carry the position back within bounds. If it is, let friction do the // work. If not, the state is invalid, so use the spring. isValidState() { const belowMinTravelingBack = this.state.x < this.options.min && this.state.v> 0; const aboveMaxTravelingBack = this.state.x > this.options.max && this.state.v < 0; if (belowMinTravelingBack || aboveMaxTravelingBack) { let bound; if (belowMinTravelingBack) { bound=t his.options.min; } else { bound=t his.options.max; } const friction=t his.frictionAnimator.options.friction; const solution=1 - friction * (bound - this.state.x) / this.state.v; return solution> 0; } return true; } // The math behind _isValidState: // // 1. Integrate the friction animator's acceleration to find velocity // // a = - k * v // dv/dt = - k * v // Int(dv/v) = - k * Int(dt) // ln v = - k * t + C // // => Solve for C at t = 0 // // ln v(0) = - k * 0 + C // ln v(0) = C // // => Plug C back into v(t) // // ln v = - k * t + ln v(0) // e^(ln v) = e^(- k * t) + e^(ln v(0)) // v = v(0) * e^(- k * t) // // 2. Integrate velocity to find position // // Int(v) = v(0) * Int(e^(- k * t)) // x = - v(0) * e^(-k * t) / k + C // // => Solve for C at t = 0 // // x(0) = - v(0) * e^(-k * 0) / k + C // x(0) = - v(0) / k + C // x(0) + v(0) / k = C // // => Plug C back into x(t) // // x = - v(0) * e^(-k * t) / k + x(0) + v(0) / k // // 3. Check if a (real) solution exists for t for position x // // x = - v(0) * e^(-k * t) / k + x(0) + v(0) / k // x - x(0) = - v(0) * e^(-k * t) / k + v(0) / k // k * (x - x(0)) = - v(0) * e^(-k * t) + v(0) // k * (x - x(0)) - v(0) = - v(0) * e^(-k * t) // (k * (x - x(0)) - v(0)) / - v(0) = e^(-k * t) // 1 - (k * (x - x(0)) / v(0) = e^(-k * t) // ln(1 - (k * (x - x(0)) / v(0)) = -k * t // // Therefore, a real solution exists if 1 - (k * (x - x(0)) / v(0) > 0 }; // ../../library/src/render/types/Color/CSSNames.ts var cssNames = { aliceblue: "f0f8ff", antiquewhite: "faebd7", aqua: "0ff", aquamarine: "7fffd4", azure: "f0ffff", beige: "f5f5dc", bisque: "ffe4c4", black: "000", blanchedalmond: "ffebcd", blue: "00f", blueviolet: "8a2be2", brown: "a52a2a", burlywood: "deb887", burntsienna: "ea7e5d", cadetblue: "5f9ea0", chartreuse: "7fff00", chocolate: "d2691e", coral: "ff7f50", cornflowerblue: "6495ed", cornsilk: "fff8dc", crimson: "dc143c", cyan: "0ff", darkblue: "00008b", darkcyan: "008b8b", darkgoldenrod: "b8860b", darkgray: "a9a9a9", darkgreen: "006400", darkgrey: "a9a9a9", darkkhaki: "bdb76b", darkmagenta: "8b008b", darkolivegreen: "556b2f", darkorange: "ff8c00", darkorchid: "9932cc", darkred: "8b0000", darksalmon: "e9967a", darkseagreen: "8fbc8f", darkslateblue: "483d8b", darkslategray: "2f4f4f", darkslategrey: "2f4f4f", darkturquoise: "00ced1", darkviolet: "9400d3", deeppink: "ff1493", deepskyblue: "00bfff", dimgray: "696969", dimgrey: "696969", dodgerblue: "1e90ff", firebrick: "b22222", floralwhite: "fffaf0", forestgreen: "228b22", fuchsia: "f0f", gainsboro: "dcdcdc", ghostwhite: "f8f8ff", gold: "ffd700", goldenrod: "daa520", gray: "808080", green: "008000", greenyellow: "adff2f", grey: "808080", honeydew: "f0fff0", hotpink: "ff69b4", indianred: "cd5c5c", indigo: "4b0082", ivory: "fffff0", khaki: "f0e68c", lavender: "e6e6fa", lavenderblush: "fff0f5", lawngreen: "7cfc00", lemonchiffon: "fffacd", lightblue: "add8e6", lightcoral: "f08080", lightcyan: "e0ffff", lightgoldenrodyellow: "fafad2", lightgray: "d3d3d3", lightgreen: "90ee90", lightgrey: "d3d3d3", lightpink: "ffb6c1", lightsalmon: "ffa07a", lightseagreen: "20b2aa", lightskyblue: "87cefa", lightslategray: "789", lightslategrey: "789", lightsteelblue: "b0c4de", lightyellow: "ffffe0", lime: "0f0", limegreen: "32cd32", linen: "faf0e6", magenta: "f0f", maroon: "800000", mediumaquamarine: "66cdaa", mediumblue: "0000cd", mediumorchid: "ba55d3", mediumpurple: "9370db", mediumseagreen: "3cb371", mediumslateblue: "7b68ee", mediumspringgreen: "00fa9a", mediumturquoise: "48d1cc", mediumvioletred: "c71585", midnightblue: "191970", mintcream: "f5fffa", mistyrose: "ffe4e1", moccasin: "ffe4b5", navajowhite: "ffdead", navy: "000080", oldlace: "fdf5e6", olive: "808000", olivedrab: "6b8e23", orange: "ffa500", orangered: "ff4500", orchid: "da70d6", palegoldenrod: "eee8aa", palegreen: "98fb98", paleturquoise: "afeeee", palevioletred: "db7093", papayawhip: "ffefd5", peachpuff: "ffdab9", peru: "cd853f", pink: "ffc0cb", plum: "dda0dd", powderblue: "b0e0e6", purple: "800080", rebeccapurple: "663399", red: "f00", rosybrown: "bc8f8f", royalblue: "4169e1", saddlebrown: "8b4513", salmon: "fa8072", sandybrown: "f4a460", seagreen: "2e8b57", seashell: "fff5ee", sienna: "a0522d", silver: "c0c0c0", skyblue: "87ceeb", slateblue: "6a5acd", slategray: "708090", slategrey: "708090", snow: "fffafa", springgreen: "00ff7f", steelblue: "4682b4", tan: "d2b48c", teal: "008080", thistle: "d8bfd8", tomato: "ff6347", turquoise: "40e0d0", violet: "ee82ee", wheat: "f5deb3", white: "fff", whitesmoke: "f5f5f5", yellow: "ff0", yellowgreen: "9acd32" }; // ../../library/src/render/types/Color/types.ts var ColorFormat = /* @__PURE__ */ ((ColorFormat2) => { ColorFormat2["RGB"] = "rgb"; ColorFormat2["HSL"] = "hsl"; ColorFormat2["HSV"] = "hsv"; ColorFormat2["HEX"] = "hex"; ColorFormat2["NAME"] = "name"; return ColorFormat2; })(ColorFormat || {}); var ColorMixModelType = /* @__PURE__ */ ((ColorMixModelType2) => { ColorMixModelType2["RGB"] = "rgb"; ColorMixModelType2["RGBA"] = "rgba"; ColorMixModelType2["HSL"] = "hsl"; ColorMixModelType2["HSLA"] = "hsla"; ColorMixModelType2["HUSL"] = "husl"; return ColorMixModelType2; })(ColorMixModelType || {}); // ../../library/src/render/types/Color/Utils.ts function modulate(value, rangeA, rangeB, limit = false) { const [fromLow, fromHigh] = rangeA; const [toLow, toHigh] = rangeB; const fromDelta = fromHigh - fromLow; if (fromDelta === 0) return (toHigh + toLow) / 2; const toDelta = toHigh - toLow; if (toDelta === 0) return toLow; const result = toLow + (value - fromLow) / fromDelta * toDelta; if (limit === true) { if (toLow < toHigh) { if (result < toLow) { return toLow; } if (result> toHigh) { return toHigh; } } else { if (result > toLow) { return toLow; } if (result < toHigh) { return toHigh; } } } return result; } function isNumeric(value) { return !isNaN(value) && isFinite(value); } function percentToFraction(val) { const digits=n umberFromString(val); if (digits !==v oid 0) { if (val.includes( "%")) { return digits / 100; } return digits; } return 0; } function numberFromString(input) { const match=/ \d?\.?\d+/u.exec(input); return match ? Number(match[0]) : void 0; } // ../../library/src/render/types/Color/converters.ts var Hsluv=/ * @__PURE__ */ (()=> require_hsluv().Hsluv)(); var hsluvConverter = /* @__PURE__ */ new Hsluv(); function rgbToHsluv(r, g, b) { hsluvConverter.rgb_r = r / 255; hsluvConverter.rgb_g = g / 255; hsluvConverter.rgb_b = b / 255; hsluvConverter.rgbToHsluv(); return { h: hsluvConverter.hsluv_h, s: hsluvConverter.hsluv_s, l: hsluvConverter.hsluv_l }; } function rgbaFromHusl(h, s, l, a = 1) { hsluvConverter.hsluv_h = h; hsluvConverter.hsluv_s = s; hsluvConverter.hsluv_l = l; hsluvConverter.hsluvToRgb(); return { r: hsluvConverter.rgb_r * 255, g: hsluvConverter.rgb_g * 255, b: hsluvConverter.rgb_b * 255, a }; } function hsvToStr(h, s, v, a) { const _h = Math.round(h); const _s = Math.round(s * 100); const _v = Math.round(v * 100); return a === void 0 || a === 1 ? "hsv(" + _h + ", " + _s + "%, " + _v + "%)" : "hsva(" + _h + ", " + _s + "%, " + _v + "%, " + a + ")"; } function rgbToRgb(r, g, b) { return { r: isNumeric(r) ? bound01(r, 255) * 255 : 0, g: isNumeric(g) ? bound01(g, 255) * 255 : 0, b: isNumeric(b) ? bound01(b, 255) * 255 : 0 }; } function rgbToHex(r, g, b, allow3Char) { const hex = [ pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16)) ]; if (allow3Char && hex[0].charAt(0) === hex[0].charAt(1) && hex[1].charAt(0) === hex[1].charAt(1) && hex[2].charAt(0) === hex[2].charAt(1)) { return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0); } return hex.join(""); } function rgbToHsl(r, g, b) { let l; let s; const _r = bound01(r, 255); const _g = bound01(g, 255); const _b = bound01(b, 255); const max = Math.max(_r, _g, _b); const min = Math.min(_r, _g, _b); let h = s = l = (max + min) / 2; if (max === min) { h = s = 0; } else { const d = max - min; s = l > 0.5 ? d / (2 - max - min) : d / (max + min); switch (max) { case _r: h = (_g - _b) / d + (_g < _b ? 6 : 0); break; case _g: h=( _b - _r) / d + 2; break; case _b: h=( _r - _g) / d + 4; break; } h /=6 ; } return { h: h * 360, s, l }; } function hue2rgb(p, q, t) { if (t < 0) { t +=1 ; } if (t> 1) { t -= 1; } if (t < 1 / 6) { return p + (q - p) * 6 * t; } if (t < 1 / 2) { return q; } if (t < 2 / 3) { return p + (q - p) * (2 / 3 - t) * 6; } return p; } function hslToRgb(h, s, l) { let r; let g; let b; h=b ound01(h, 360); s=b ound01(s * 100, 100); l=b ound01(l * 100, 100); if (s===0 ) { r=g=b=l ; } else { const q=l < 0.5 ? l * (1 + s) : l + s - l * s; const p=2 * l - q; r=h ue2rgb(p, q, h + 1 / 3); g=h ue2rgb(p, q, h); b=h ue2rgb(p, q, h - 1 / 3); } return { r: r * 255, g: g * 255, b: b * 255 }; } function rgbToHsv(r, g, b) { r=b ound01(r, 255); g=b ound01(g, 255); b=b ound01(b, 255); const max=M ath.max(r, g, b); const min=M ath.min(r, g, b); const d=m ax - min; let h; const s=m ax===0 ? 0 : d / max; const v=m ax; if (max===m in) { h=0 ; } else { switch (max) { case r: h=( g - b) / d + (g < b ? 6 : 0); break; case g: h=( b - r) / d + 2; break; case b: h=( r - g) / d + 4; break; } h /=6 ; } return { h, s, v }; } function hsvToRgb(h, s, v) { h=b ound01(h, 360) * 6; s=b ound01(s * 100, 100); v=b ound01(v * 100, 100); const i=M ath.floor(h); const f=h - i; const p=v * (1 - s); const q=v * (1 - f * s); const t=v * (1 - (1 - f) * s); const mod=i % 6; const r=[ v, q, p, p, t, v][mod]; const g=[ t, v, v, q, p, p][mod]; const b=[ p, p, t, v, v, q][mod]; return { r: r * 255, g: g * 255, b: b * 255 }; } function bound01(n, max) { let _max; let _n; if (typeof max==="string" ) _max=p arseFloat(max); else _max=m ax; if (typeof n==="string" ) { if (isOnePointZero(n)) { n="100%" ; } const processPercent=i sPercentage(n); _n=M ath.min(_max, Math.max(0, parseFloat(n))); if (processPercent) { _n=M ath.floor(_n * _max) / 100; } } else { _n=n ; } if (Math.abs(_n - _max) < 1e-6) { return 1; } return _n % _max / _max; } function isOnePointZero(n) { return typeof n==="string" && n.includes( ".") && parseFloat(n)===1 ; } function isPercentage(n) { return typeof n==="string" && n.includes( "%"); } function pad2(char) { if (char.length===1 ) { return "0" + char; } else { return "" + char; } } var matchers=/ * @__PURE__ */ (()=> { const cssInteger = "[-\\+]?\\d+%?"; const cssNumber = "[-\\+]?\\d*\\.\\d+%?"; const cssUnit = "(?:" + cssNumber + ")|(?:" + cssInteger + ")"; const permissiveMatch3 = "[\\s|\\(]+(" + cssUnit + ")[,|\\s]+(" + cssUnit + ")[,|\\s]+(" + cssUnit + ")\\s*\\)?"; const permissiveMatch4 = "[\\s|\\(]+(" + cssUnit + ")[,|\\s]+(" + cssUnit + ")[,|\\s]+(" + cssUnit + ")[,|\\s]+(" + cssUnit + ")\\s*\\)?"; return { rgb: new RegExp("rgb" + permissiveMatch3), rgba: new RegExp("rgba" + permissiveMatch4), hsl: new RegExp("hsl" + permissiveMatch3), hsla: new RegExp("hsla" + permissiveMatch4), hsv: new RegExp("hsv" + permissiveMatch3), hsva: new RegExp("hsva" + permissiveMatch4), hex3: /^([\da-f])([\da-f])([\da-f])$/iu, hex6: /^([\da-f]{2})([\da-f]{2})([\da-f]{2})$/iu, hex4: /^#?([\da-f])([\da-f])([\da-f])([\da-f])$/iu, hex8: /^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})([\da-f]{2})$/iu }; })(); function stringToObject(inputColor) { if (inputColor.includes("gradient(")) return false; if (inputColor.includes("var(")) return false; const trimLeft = /^[\s,#]+/u; let color2 = inputColor.replace(trimLeft, "").trimEnd().toLowerCase(); const namedColor = cssNames[color2]; if (namedColor) { color2 = namedColor; } if (color2 === "transparent") { return { r: 0, g: 0, b: 0, a: 0, format: "name" /* NAME */ }; } let match; if (match = matchers.rgb.exec(color2)) { return { r: parseInt(match[1] ?? ""), g: parseInt(match[2] ?? ""), b: parseInt(match[3] ?? ""), a: 1, format: "rgb" /* RGB */ }; } if (match = matchers.rgba.exec(color2)) { return { r: parseInt(match[1] ?? ""), g: parseInt(match[2] ?? ""), b: parseInt(match[3] ?? ""), a: parseFloat(match[4] ?? ""), format: "rgb" /* RGB */ }; } if (match = matchers.hsl.exec(color2)) { return { h: parseInt(match[1] ?? ""), s: percentToFraction(match[2] ?? ""), l: percentToFraction(match[3] ?? ""), a: 1, format: "hsl" /* HSL */ }; } if (match = matchers.hsla.exec(color2)) { return { h: parseInt(match[1] ?? ""), s: percentToFraction(match[2] ?? ""), l: percentToFraction(match[3] ?? ""), a: parseFloat(match[4] ?? ""), format: "hsl" /* HSL */ }; } if (match = matchers.hsv.exec(color2)) { return { h: parseInt(match[1] ?? ""), s: percentToFraction(match[2] ?? ""), v: percentToFraction(match[3] ?? ""), a: 1, format: "hsv" /* HSV */ }; } if (match = matchers.hsva.exec(color2)) { return { h: parseInt(match[1] ?? ""), s: percentToFraction(match[2] ?? ""), v: percentToFraction(match[3] ?? ""), a: parseFloat(match[4] ?? ""), format: "hsv" /* HSV */ }; } if (match = matchers.hex8.exec(color2)) { return { r: parseIntFromHex(match[1] ?? ""), g: parseIntFromHex(match[2] ?? ""), b: parseIntFromHex(match[3] ?? ""), a: convertHexToDecimal(match[4] ?? ""), format: namedColor ? "name" /* NAME */ : "hex" /* HEX */ }; } if (match = matchers.hex6.exec(color2)) { return { r: parseIntFromHex(match[1] ?? ""), g: parseIntFromHex(match[2] ?? ""), b: parseIntFromHex(match[3] ?? ""), a: 1, format: namedColor ? "name" /* NAME */ : "hex" /* HEX */ }; } if (match = matchers.hex4.exec(color2)) { return { r: parseIntFromHex(`${match[1]}${match[1]}`), g: parseIntFromHex(`${match[2]}${match[2]}`), b: parseIntFromHex(`${match[3]}${match[3]}`), a: convertHexToDecimal(match[4] + "" + match[4]), format: namedColor ? "name" /* NAME */ : "hex" /* HEX */ }; } if (match = matchers.hex3.exec(color2)) { return { r: parseIntFromHex(`${match[1]}${match[1]}`), g: parseIntFromHex(`${match[2]}${match[2]}`), b: parseIntFromHex(`${match[3]}${match[3]}`), a: 1, format: namedColor ? "name" /* NAME */ : "hex" /* HEX */ }; } else { return false; } } function parseIntFromHex(hex) { return parseInt(hex, 16); } function convertHexToDecimal(h) { return parseIntFromHex(h) / 255; } // ../../library/src/render/types/Color/Color.ts var cache = /* @__PURE__ */ new Map(); var Color = /* @__PURE__ */ (() => { function Color2(color2, r, g, b) { if (typeof color2 === "string") { let c = cache.get(color2); if (c) return c; c = createColor(color2); if (c === void 0) return { ...Color2("black"), isValid: false }; cache.set(color2, c); return c; } const created = createColor(color2, r, g, b); return created !== void 0 ? created : { ...Color2("black"), isValid: false }; } function createColor(color2, r, g, b) { if (color2 === "") return void 0; const colorData = getCompleteColorStrategy(color2, r, g, b); if (colorData) { const newColor = { r: colorData.r, g: colorData.g, b: colorData.b, a: colorData.a, h: colorData.h, s: colorData.s, l: colorData.l, initialValue: typeof color2 === "string" && colorData.format !== "hsv" /* HSV */ ? color2 : void 0, roundA: Math.round(100 * colorData.a) / 100, format: colorData.format, mix: Color2.mix, toValue: () => Color2.toRgbString(newColor) }; return newColor; } else { return void 0; } } const ColorMixModel = { isRGB(colorModel) { return colorModel === "rgb" /* RGB */ || colorModel === "rgba" /* RGBA */; }, isHSL(colorModel) { return colorModel === "hsl" /* HSL */ || colorModel === "hsla" /* HSLA */; } }; Color2.inspect = (color2, initialValue) => { if (color2.format === "hsl" /* HSL */) { return ` <${color2.constructor.name} h:${color2.h} s:${color2.s} l:${color2.l} a:${color2.a}>`; } else if (color2.format === "hex" /* HEX */ || color2.format === "name" /* NAME */) { return ` <${color2.constructor.name} "${initialValue}">`; } else { return ` <${color2.constructor.name} r:${color2.r} g:${color2.g} b:${color2.b} a:${color2.a}>`; } }; Color2.isColor = (color2) => { if (typeof color2 === "string") { return Color2.isColorString(color2); } else { return Color2.isColorObject(color2); } }; Color2.isColorString = (colorString) => { if (typeof colorString === "string") { return stringToObject(colorString) !== false; } return false; }; Color2.isColorObject = (color2) => { return color2 && typeof color2 !== "string" && typeof color2.r === "number" && typeof color2.g === "number" && typeof color2.b === "number" && typeof color2.h === "number" && typeof color2.s === "number" && typeof color2.l === "number" && typeof color2.a === "number" && typeof color2.roundA === "number" && typeof color2.format === "string"; }; Color2.toString = (color2) => { return Color2.toRgbString(color2); }; Color2.toHex = (color2, allow3Char = false) => { return rgbToHex(color2.r, color2.g, color2.b, allow3Char); }; Color2.toHexString = (color2, allow3Char = false) => { return `#${Color2.toHex(color2, allow3Char)}`; }; Color2.toRgbString = (color2) => { return color2.a === 1 ? "rgb(" + Math.round(color2.r) + ", " + Math.round(color2.g) + ", " + Math.round(color2.b) + ")" : "rgba(" + Math.round(color2.r) + ", " + Math.round(color2.g) + ", " + Math.round(color2.b) + ", " + color2.roundA + ")"; }; Color2.toHusl = (color2) => { return { ...rgbToHsluv(color2.r, color2.g, color2.b), a: color2.roundA }; }; Color2.toHslString = (color2) => { const hsl = Color2.toHsl(color2); const h = Math.round(hsl.h); const s = Math.round(hsl.s * 100); const l = Math.round(hsl.l * 100); return color2.a === 1 ? "hsl(" + h + ", " + s + "%, " + l + "%)" : "hsla(" + h + ", " + s + "%, " + l + "%, " + color2.roundA + ")"; }; Color2.toHsv = (color2) => { const hsv = rgbToHsv(color2.r, color2.g, color2.b); return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: color2.a }; }; Color2.toHsvString = (color2) => { const hsv = rgbToHsv(color2.r, color2.g, color2.b); const h = Math.round(hsv.h * 360); const s = Math.round(hsv.s * 100); const v = Math.round(hsv.v * 100); return color2.a === 1 ? "hsv(" + h + ", " + s + "%, " + v + "%)" : "hsva(" + h + ", " + s + "%, " + v + "%, " + color2.roundA + ")"; }; Color2.toName = (color2) => { if (color2.a === 0) { return "transparent"; } if (color2.a < 1) { return false; } const hex=r gbToHex(color2.r, color2.g, color2.b, true); for (const key7 of Object.keys(cssNames)) { const value=c ssNames[key7]; if (value===h ex) { return key7; } } return false; }; Color2.toHsl=( color2)=> { return { h: Math.round(color2.h), s: color2.s, l: color2.l, a: color2.a }; }; Color2.toRgb = (color2) => { return { r: Math.round(color2.r), g: Math.round(color2.g), b: Math.round(color2.b), a: color2.a }; }; Color2.brighten = (color2, amount = 10) => { const rgb = Color2.toRgb(color2); rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100)))); rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100)))); rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100)))); return Color2(rgb); }; Color2.lighten = (color2, amount = 10) => { const hsl = Color2.toHsl(color2); hsl.l += amount / 100; hsl.l = Math.min(1, Math.max(0, hsl.l)); return Color2(hsl); }; Color2.darken = (color2, amount = 10) => { const hsl = Color2.toHsl(color2); hsl.l -= amount / 100; hsl.l = Math.min(1, Math.max(0, hsl.l)); return Color2(hsl); }; Color2.saturate = (color2, amount = 10) => { const hsl = Color2.toHsl(color2); hsl.s += amount / 100; hsl.s = Math.min(1, Math.max(0, hsl.s)); return Color2(hsl); }; Color2.desaturate = (color2, amount = 10) => { const hsl = Color2.toHsl(color2); hsl.s -= amount / 100; hsl.s = Math.min(1, Math.max(0, hsl.s)); return Color2(hsl); }; Color2.grayscale = (color2) => { return Color2.desaturate(color2, 100); }; Color2.hueRotate = (color2, angle) => { const hsl = Color2.toHsl(color2); hsl.h += angle; hsl.h = hsl.h > 360 ? hsl.h - 360 : hsl.h; return Color2(hsl); }; Color2.alpha = (color2, a = 1) => { return Color2({ r: color2.r, g: color2.g, b: color2.b, a }); }; Color2.transparent = (color2) => { return Color2.alpha(color2, 0); }; Color2.multiplyAlpha = (color2, alphaValue = 1) => { return Color2({ r: color2.r, g: color2.g, b: color2.b, a: color2.a * alphaValue }); }; Color2.interpolate = (colorA, colorB, model = "rgb" /* RGB */) => { if (!Color2.isColorObject(colorA) || !Color2.isColorObject(colorB)) { throw new TypeError("Both arguments for Color.interpolate must be Color objects"); } return (progress2) => { const color2 = Color2.mixAsColor(colorA, colorB, progress2, false, model); return color2; }; }; Color2.mix = (from, toColor, { model = "rgb" /* RGB */ } = {}) => { const fromColor = typeof from === "string" ? Color2(from) : from; const mixer = Color2.interpolate(fromColor, toColor, model); return (p) => Color2.toRgbString(mixer(p)); }; Color2.mixAsColor = (colorA, colorB, fraction2 = 0.5, limit = false, model = "rgb" /* RGB */) => { let result = null; if (ColorMixModel.isRGB(model)) { result = Color2({ r: modulate(fraction2, [0, 1], [colorA.r, colorB.r], limit), g: modulate(fraction2, [0, 1], [colorA.g, colorB.g], limit), b: modulate(fraction2, [0, 1], [colorA.b, colorB.b], limit), a: modulate(fraction2, [0, 1], [colorA.a, colorB.a], limit) }); } else { let hslA, hslB; if (ColorMixModel.isHSL(model)) { hslA = Color2.toHsl(colorA); hslB = Color2.toHsl(colorB); } else { hslA = Color2.toHusl(colorA); hslB = Color2.toHusl(colorB); } if (hslA.s === 0) { hslA.h = hslB.h; } else if (hslB.s === 0) { hslB.h = hslA.h; } const fromH = hslA.h; const toH = hslB.h; let deltaH = toH - fromH; if (deltaH > 180) { deltaH = toH - 360 - fromH; } else if (deltaH < -180) { deltaH=t oH + 360 - fromH; } const tween={ h: modulate(fraction2, [0, 1], [fromH, fromH + deltaH], limit), s: modulate(fraction2, [0, 1], [hslA.s, hslB.s], limit), l: modulate(fraction2, [0, 1], [hslA.l, hslB.l], limit), a: modulate(fraction2, [0, 1], [colorA.a, colorB.a], limit) }; if (ColorMixModel.isHSL(model)) { result=C olor2(tween); } else { result=C olor2(rgbaFromHusl(tween.h, tween.s, tween.l, tween.a)); } } return result; }; Color2.random=( alphaValue=1 )=> { function gen() { return Math.floor(Math.random() * 255); } return Color2("rgba(" + gen() + ", " + gen() + ", " + gen() + ", " + alphaValue + ")"); }; Color2.grey = (amount = 0.5, alphaValue = 1) => { amount = Math.floor(amount * 255); return Color2("rgba(" + amount + ", " + amount + ", " + amount + ", " + alphaValue + ")"); }; Color2.gray = Color2.grey; Color2.rgbToHsl = (r, g, b) => { return rgbToHsl(r, g, b); }; Color2.isValidColorProperty = (name, value) => { const isColorKey = name.toLowerCase().slice(-5) === "color" || name === "fill" || name === "stroke"; if (isColorKey && typeof value === "string" && Color2.isColorString(value)) { return true; } return false; }; Color2.difference = (colorA, colorB) => { const _r = (colorA.r + colorB.r) / 2; const deltaR = colorA.r - colorB.r; const deltaG = colorA.g - colorB.g; const deltaB = colorA.b - colorB.b; const deltaR2 = Math.pow(deltaR, 2); const deltaG2 = Math.pow(deltaG, 2); const deltaB2 = Math.pow(deltaB, 2); return Math.sqrt(2 * deltaR2 + 4 * deltaG2 + 3 * deltaB2 + _r * (deltaR2 - deltaB2) / 256); }; Color2.equal = (colorA, colorB, tolerance = 0.1) => { if (Math.abs(colorA.r - colorB.r) >= tolerance) { return false; } if (Math.abs(colorA.g - colorB.g) >= tolerance) { return false; } if (Math.abs(colorA.b - colorB.b) >= tolerance) { return false; } if (Math.abs(colorA.a - colorB.a) * 256 >= tolerance) { return false; } return true; }; const channelToDecimal = interpolate([0, 255], [0, 1]); function convertChannelToLinearRgb(channel) { channel = channelToDecimal(channel); const abs = Math.abs(channel); if (abs < 0.04045) return channel / 12.92; return (Math.sign(channel) || 1) * Math.pow((abs + 0.055) / 1.055, 2.4); } Color2.luminance=( color2)=> { const { r, g, b } = Color2.toRgb(color2); return 0.2126 * convertChannelToLinearRgb(r) + 0.7152 * convertChannelToLinearRgb(g) + 0.0722 * convertChannelToLinearRgb(b); }; Color2.contrast = (a, b) => { const l1 = Color2.luminance(a); const l2 = Color2.luminance(b); return (Math.max(l1, l2) + 0.05) / (Math.min(l1, l2) + 0.05); }; return Color2; })(); function getCompleteColorStrategy(colorOrR, g, b, a = 1) { let completeColor; if (typeof colorOrR === "number" && !Number.isNaN(colorOrR) && typeof g === "number" && !Number.isNaN(g) && typeof b === "number" && !Number.isNaN(b)) { const _r = colorOrR; const _g = g; const _b = b; const _a = a; completeColor = getCompleteColorFromRGB({ r: _r, g: _g, b: _b, a: _a }); } else if (typeof colorOrR === "string") { completeColor = getCompleteColorFromString(colorOrR); } else if (typeof colorOrR === "object") { if (colorOrR.hasOwnProperty("r") && colorOrR.hasOwnProperty("g") && colorOrR.hasOwnProperty("b")) { completeColor = getCompleteColorFromRGB(colorOrR); } else { completeColor = getCompleteColorFromHSL(colorOrR); } } return completeColor; } function getCompleteColorFromString(color2) { const result = stringToObject(color2); if (result) { if (result.format === "hsl" /* HSL */) { return getCompleteColorFromHSL(result); } else if (result.format === "hsv" /* HSV */) { return getCompleteColorFromHSV(result); } else { return getCompleteColorFromRGB(result); } } } function getCompleteColorFromHSV(color2) { const rgb = hsvToRgb(color2.h, color2.s, color2.v); const hsl = rgbToHsl(rgb.r, rgb.g, rgb.b); return { ...hsl, ...rgb, format: "rgb" /* RGB */, a: color2.a !== void 0 ? correctAlpha(color2.a) : 1 }; } function getCompleteColorFromRGB(color2) { const rgb = rgbToRgb(color2.r, color2.g, color2.b); const hsl = rgbToHsl(rgb.r, rgb.g, rgb.b); return { ...hsl, ...rgb, format: "rgb" /* RGB */, a: color2.a !== void 0 ? correctAlpha(color2.a) : 1 }; } function getCompleteColorFromHSL(color2) { let h; let s; let l; let rgb = { r: 0, g: 0, b: 0 }; let hsl = { h: 0, s: 0, l: 0 }; h = isNumeric(color2.h) ? color2.h : 0; h = (h + 360) % 360; s = isNumeric(color2.s) ? color2.s : 1; if (typeof color2.s === "string") { s = numberFromString(color2.s); } l = isNumeric(color2.l) ? color2.l : 0.5; if (typeof color2.l === "string") { l = numberFromString(color2.l); } rgb = hslToRgb(h, s, l); hsl = { h, s, l }; return { ...rgb, ...hsl, a: color2.a === void 0 ? 1 : color2.a, format: "hsl" /* HSL */ }; } function correctAlpha(alphaValue) { alphaValue = parseFloat(alphaValue); if (alphaValue < 0) { alphaValue=0 ; } if (isNaN(alphaValue) || alphaValue> 1) { alphaValue = 1; } return alphaValue; } // ../../library/src/interpolation/ColorInterpolation.ts var ColorInterpolation = (type = "husl" /* HUSL */) => { return { interpolate(from, to) { ; [from, to] = Interpolation.handleUndefined(from, to); return Color.interpolate(Color(from), Color(to), type); }, difference(from, to) { return Color.difference(Color(from), Color(to)); } }; }; // ../../library/src/interpolation/NoInterpolation.ts var NoInterpolation = { interpolate(from, to) { ; [from, to] = Interpolation.handleUndefined(from, to); return (progress2) => { return progress2 < 0.5 ? from : to; }; }, difference(from, to) { return from===t o ? 0 : 1; } }; // ../../library/src/interpolation/ObjectInterpolation.ts var ObjectInterpolation=( valueInterpolation)=> { return { interpolate(from, to) { ; [from, to] = Interpolation.handleUndefined(from, to); const result = Object.assign({}, from); const interpolations = {}; const keys3 = /* @__PURE__ */ new Set(); for (const key7 in from) { interpolations[key7] = valueInterpolation.interpolate(from[key7], to[key7]); keys3.add(key7); } for (const key7 in to) { if (!keys3.has(key7)) { interpolations[key7] = valueInterpolation.interpolate(from[key7], to[key7]); keys3.add(key7); } } return (progress2) => { for (const key7 in interpolations) { result[key7] = interpolations[key7](progress2); } return result; }; }, difference(from, to) { let sum = 0; for (const key7 in from) { const difference = valueInterpolation.difference(from[key7], to[key7]); sum += Math.pow(difference, 2); } return Math.sqrt(sum); } }; }; // ../../library/src/interpolation/ValueInterpolation.ts var DefaultInterpolationOptions = { colorModel: "husl" /* HUSL */ }; var ValueInterpolation = class { /** * @internal */ constructor(options = DefaultInterpolationOptions) { __publicField(this, "options"); /** * @internal */ __publicField(this, "interpolate", (from, to) => { ; [from, to] = Interpolation.handleUndefined(from, to); return this.interPolationForValue(from).interpolate(from, to); }); /** * @internal */ __publicField(this, "difference", (from, to) => { const interpolation = this.interPolationForValue(from); return interpolation.difference(from, to); }); this.options = { ...DefaultInterpolationOptions, ...options }; } /** * @internal */ interPolationForValue(value) { const type = typeof value; if (type === "number") { return NumberInterpolation; } else if (type === "boolean" || type === "function") { return NoInterpolation; } else if (Color.isColor(value)) { return ColorInterpolation(this.options.colorModel); } else if (type === "object") { if (value === null) { return NoInterpolation; } const constructor = value.constructor; if (constructor && isInterpolatable(constructor)) { const interpolation = constructor.interpolationFor(value, this); if (interpolation && interpolation !== this && interpolation.constructor !== ValueInterpolation) { return interpolation; } } return ObjectInterpolation(this); } console.warn(`No interpolation defined for ${value}`); return NoInterpolation; } }; var AnyInterpolation = /* @__PURE__ */ new ValueInterpolation(); // ../../library/src/render/utils/isMotionValue.ts var isMotionValue2 = (v) => v instanceof MotionValue; // ../../library/src/animation/Animators/PrecalculatedAnimator.ts var Defaults2 = /* @__PURE__ */ (() => ({ delta: 1 / 60, maxValues: 1e4 }))(); var PrecalculatedAnimator = class { constructor(options) { __publicField(this, "animator"); __publicField(this, "values"); __publicField(this, "currentTime", 0); __publicField(this, "totalTime"); __publicField(this, "options"); this.options = { ...Defaults2, ...options }; this.animator = options.animator; } preCalculate() { if (!this.animator.isReady()) { return; } const { delta } = this.options; this.values = []; while (!this.animator.isFinished() && this.values.length < this.options.maxValues) { let value=t his.animator.next(this.options.delta); if (typeof value==="object" && value) { const object=v alue; const copy={ ...object }; value=c opy; } this.values.push(value); } this.totalTime=t his.values.length * delta; } indexForTime(time) { return Math.max( 0, Math.min(this.values.length - 1, Math.round(this.values.length * (time / this.totalTime)) - 1) ); } valueForTime(time) { const index=t his.indexForTime(time); const value=t his.values[index]; return value; } setFrom(value) { this.animator.setFrom(value); this.preCalculate(); } setTo(end) { this.animator.setTo(end); this.preCalculate(); } isReady() { return this.values !==v oid 0 && this.values.length> 0 && this.totalTime > 0; } next(delta) { this.currentTime += delta; return this.valueForTime(this.currentTime); } isFinished() { return this.totalTime === 0 || this.currentTime >= this.totalTime; } get endValue() { this.preCalculate(); const value = this.valueForTime(this.totalTime); return this.values.length > 0 ? value : this.animator.next(0); } }; // ../../library/src/core/EventEmitter.ts var EventEmitter3 = /* @__PURE__ */ (() => require_eventemitter3().EventEmitter)(); var EventEmitter = class { constructor() { __publicField(this, "_emitter", new EventEmitter3()); } eventNames() { return this._emitter.eventNames(); } eventListeners() { const listeners = {}; for (const eventName of this._emitter.eventNames()) { listeners[eventName] = this._emitter.listeners(eventName); } return listeners; } on(eventName, fn) { this.addEventListener(eventName, fn, false, false, this); } off(eventName, fn) { this.removeEventListeners(eventName, fn); } once(eventName, fn) { this.addEventListener(eventName, fn, true, false, this); } unique(eventName, fn) { this.addEventListener(eventName, fn, false, true, this); } addEventListener(eventName, fn, once, unique, context) { if (unique) { for (const name of this._emitter.eventNames()) { if (fn === this._emitter.listeners(name)) { return; } } } if (once === true) { this._emitter.once(eventName, fn, context); } else { this._emitter.addListener(eventName, fn, context); } } removeEventListeners(eventName, fn) { if (eventName) { this._emitter.removeListener(eventName, fn); } else { this.removeAllEventListeners(); } } removeAllEventListeners() { this._emitter.removeAllListeners(); } countEventListeners(eventName, handler) { if (eventName) { return this._emitter.listeners(eventName).length; } else { let count = 0; for (const name of this._emitter.eventNames()) { count += this._emitter.listeners(name).length; } return count; } } emit(eventName, ...args) { this._emitter.emit(eventName, ...args); } }; // ../../library/src/utils/safeWindow.ts var mockWindow = { addEventListener: () => { }, removeEventListener: () => { }, dispatchEvent: () => false, ResizeObserver: void 0, onpointerdown: false, onpointermove: false, onpointerup: false, ontouchstart: false, ontouchmove: false, ontouchend: false, onmousedown: false, onmousemove: false, onmouseup: false, devicePixelRatio: 1, scrollX: 0, scrollY: 0, location: { href: "" }, setTimeout: () => 0, clearTimeout: () => { }, setInterval: () => 0, clearInterval: () => { }, requestAnimationFrame: () => 0, cancelAnimationFrame: () => { }, getSelection: () => null, matchMedia: (query) => { return { matches: false, media: query, onchange: () => { }, addEventListener: () => { }, removeEventListener: () => { }, addListener: () => { }, removeListener: () => { }, dispatchEvent: () => false }; }, innerHeight: 0, innerWidth: 0, SVGSVGElement: {}, open: function(_url, _target, _features) { } }; var safeWindow = typeof window === "undefined" ? mockWindow : window; // ../../library/src/core/Time.ts var _raf = (f) => { setTimeout(f, 1 / 60); }; var __raf = /* @__PURE__ */ (() => safeWindow["requestAnimationFrame"] || _raf)(); var raf = (f) => __raf(f); // ../../library/src/core/Loop.ts var LoopTimeStep = /* @__PURE__ */ (() => 1 / 60)(); var Loop = class extends EventEmitter { /** * @internal */ constructor(start = false) { super(); __publicField(this, "_started", false); __publicField(this, "_frame", 0); __publicField(this, "_frameTasks", []); /** * @internal */ __publicField(this, "tick", () => { if (!this._started) return; raf(this.tick); this.emit("update", this._frame, LoopTimeStep); this.emit("render", this._frame, LoopTimeStep); this._processFrameTasks(); this._frame++; }); if (start) { this.start(); } } /** * To add a task to be done at the end of a frame. * Tasks added from a task will be ignored. These will run after loop events have been processed. * @internal */ addFrameTask(task) { this._frameTasks.push(task); } _processFrameTasks() { var _a; const postEventTasks = this._frameTasks; const length = postEventTasks.length; if (length === 0) return; for (let i = 0; i < length; i++) { (_a=p ostEventTasks[i])==n ull ? void 0 : _a.call(postEventTasks); } postEventTasks.length=0 ; } /** * @internal */ static set TimeStep(value) { LoopTimeStep=v alue; } /** * @internal */ static get TimeStep() { return LoopTimeStep; } /** * @internal */ start() { if (this._started) return this; this._frame=0 ; this._started=t rue; raf(this.tick); return this; } /** * @internal * @deprecated Don’t use `stop` as you could be stopping the MainLoop for others. */ stop() { this._started=f alse; return this; } /** * @internal */ get frame() { return this._frame; } /** * @internal */ get time() { return this._frame * LoopTimeStep; } }; var MainLoop=/ * @__PURE__ */ new Loop(); // ../../library/src/render/types/RenderEnvironment.ts var RenderEnvironment={ target: "PREVIEW" /* preview */, zoom: 1 }; function executeInRenderEnvironment(customEnvironment, task) { const previousEnvironment=O bject.assign({}, RenderEnvironment); Object.assign(RenderEnvironment, customEnvironment); const result=t ask(); Object.assign(RenderEnvironment, previousEnvironment); return result; } function setGlobalRenderEnvironment(environment2) { Object.assign(RenderEnvironment, environment2); } function useRenderEnvironment(target, zoom) { let willChangeElements=f alse; if (RenderEnvironment.target !==t arget) { RenderEnvironment.target=t arget; willChangeElements=t rue; } if (RenderEnvironment.zoom !==z oom) { RenderEnvironment.zoom=z oom; } return { willChangeElements }; } var RenderTarget={ /** * The component is to be rendered for the Framer canvas. * * @remarks * ```jsx * function App() { * if (RenderTarget.current()===R enderTarget.canvas) { * return * } * return * } * ``` */ canvas: "CANVAS" /* canvas */, /** * The component is to be rendered for export. * * @remarks * ```jsx * function App() { * if (RenderTarget.current() === RenderTarget.export) { * return * } * return * } * ``` */ export: "EXPORT" /* export */, /** * The component is to be rendered as a preview thumbnail, for example in the * component panel. * * @remarks * ```jsx * function App() { * if (RenderTarget.current() === RenderTarget.thumbnail) { * return * } * return * } * ``` */ thumbnail: "THUMBNAIL" /* thumbnail */, /** * The component is being rendered in the preview window. * * @remarks * ```jsx * function App() { * React.useEffect(() => { * if (RenderTarget.current() === RenderTarget.preview) { * // Do something in preview. * } * }) * return * } * ``` */ preview: "PREVIEW" /* preview */, /** * Returns the current `RenderTarget` allowing components to apply * different behaviors depending on the environment. * * @remarks * ```jsx * function App() { * if (RenderTarget.current() === RenderTarget.thumbnail) { * return * } * return ... * } * ``` */ current: () => RenderEnvironment.target, /** * Returns true if the current `RenderTarget` has performance restrictions. * Use this to avoid doing heavy work in these contexts because they may * bail on the rendering if the component takes too long. * * @remarks * ```jsx * function App() { * if (RenderTarget.hasRestrictions()) { * return * } * return * } * ``` */ hasRestrictions: () => { const target = RenderEnvironment.target; if (target === "CANVAS" /* canvas */) return true; if (target === "EXPORT" /* export */) return true; return false; } }; // ../../library/src/animation/Drivers/AnimationDriver.ts var AnimationDriver = class { constructor(animator, updateCallback, finishedCallback) { this.animator = animator; this.updateCallback = updateCallback; this.finishedCallback = finishedCallback; __publicField(this, "update", (frame2, elapsed) => { if (this.animator.isFinished()) { this.finish(); } else { const value = this.animator.next(elapsed); this.updateCallback(value); } }); if (!this.animator.isReady()) { console.warn("AnimationDriver initialized with animator that isn't ready"); } } finish() { if (this.finishedCallback) { this.finishedCallback(this.animator.isFinished()); } } isFinished() { return this.animator.isFinished(); } }; // ../../library/src/animation/Drivers/MainLoopDriver.ts var MainLoopAnimationDriver = class extends AnimationDriver { play() { if (RenderEnvironment.target !== RenderTarget.preview) { this.finishedCallback && this.finishedCallback(false); return; } MainLoop.on("update", this.update); } cancel() { MainLoop.off("update", this.update); } finish() { MainLoop.off("update", this.update); super.finish(); } }; // ../../library/src/animation/FramerAnimation.ts var DefaultDeprecatedAnimationOptions = { precalculate: false, colorModel: "husl" /* HUSL */ }; var FramerAnimation = class { /** * @internal */ constructor(target, from, to, animatorClass, options, driverClass = MainLoopAnimationDriver) { /** * @internal */ __publicField(this, "driver"); /** * @internal */ __publicField(this, "playStateSource", "idle"); /** * @internal */ __publicField(this, "onfinish"); /** * @internal */ __publicField(this, "oncancel"); /** * @internal */ __publicField(this, "readyPromise", Promise.resolve()); /** * @internal */ __publicField(this, "readyResolve"); /** * @internal */ __publicField(this, "finishedPromise"); /** * @internal */ __publicField(this, "finishedResolve"); /** * @internal */ __publicField(this, "finishedReject"); this.resetFinishedPromise(); const deprecatedAnimationOptions = { ...DefaultDeprecatedAnimationOptions }; const animatorOptions = {}; if (options) { Object.assign(deprecatedAnimationOptions, options); Object.assign(animatorOptions, options); } let interpolation; if (deprecatedAnimationOptions.customInterpolation) { interpolation = deprecatedAnimationOptions.customInterpolation; } else { interpolation = new ValueInterpolation(options); } let animator; if (!animatorClass) { animator = new BezierAnimator({}, interpolation); } else { animator = new animatorClass(animatorOptions, interpolation); } if (deprecatedAnimationOptions.precalculate) { animator = new PrecalculatedAnimator({ animator }); } animator.setFrom(from); animator.setTo(to); const updateCallback = (value) => { FramerAnimation.driverCallbackHandler(target, value); }; const finishedCallback = (isFinished) => { if (isFinished) { FramerAnimation.driverCallbackHandler(target, to); if (this.playStateSource === "running") { this.playStateValue = "finished"; } } }; this.driver = new driverClass(animator, updateCallback, finishedCallback); } /** * @internal */ static driverCallbackHandler(target, value) { if (isAnimatable(target) || isMotionValue2(target)) { target.set(value); } else { const targetObject = target; Animatable.transaction((update) => { for (const key7 in targetObject) { const targetValue = targetObject[key7]; if (isAnimatable(targetValue)) { update(targetValue, value[key7]); } else { targetObject[key7] = value[key7]; } } }); } } /** * @internal */ get playStateValue() { return this.playStateSource; } /** * @internal */ set playStateValue(value) { if (value !== this.playStateSource) { const oldValue = value; this.playStateSource = value; switch (value) { case "idle": if (oldValue === "running") { this.oncancel && this.oncancel(); } this.readyResolve && this.readyResolve(); this.resetReadyPromise(); break; case "finished": if (oldValue === "idle") { console.warn("Bad state transition"); break; } this.onfinish && this.onfinish(); this.finishedResolve && this.finishedResolve(); break; case "running": this.resetReadyPromise(); break; } if (oldValue === "finished") { this.resetFinishedPromise(); } if (value === "finished") { this.playStateValue = "idle"; } } } /** * @internal */ get playState() { return this.playStateValue; } /** * @internal */ resetReadyPromise() { this.readyResolve = null; this.readyPromise = new Promise((resolve, reject) => { this.readyResolve = resolve; }); } /** * Wait for the animation to be ready to play. * @remarks * ```jsx * const animation = animate.ease(value, 100) * animation.ready().then(() => { * // Animation is ready * }) * // async/await syntax * const animation = animate.ease(value, 100) * await animation.ready() * // Animation is ready * ``` * @returns Promise that is resolved when the animation is ready to play * @public */ get ready() { return this.readyPromise; } /** * @internal */ resetFinishedPromise() { this.finishedResolve = null; this.finishedReject = null; this.finishedPromise = new Promise((resolve, reject) => { this.finishedResolve = resolve; this.finishedReject = reject; }); this.finishedPromise.catch((reason) => { }); } /** * Wait for the animation to be finished. * @remarks * ```jsx * // async/await syntax * const animation = animate.ease(value, 100) * await animation.finished() * // Animation is finished * * * const animation = animate.ease(value, 100) * animation.ready().then(() => { * // Animation is finished * }) * ``` * @returns Promise that is resolved when the animation is ready to play * @public */ get finished() { return this.finishedPromise; } /** * @internal */ play() { this.playStateValue = "running"; this.driver.play(); } /** * Cancels the animation if it is still running. * @remarks * ```jsx * const animation = animate.ease(value, 100, {duration: 3}) * setTimeout(() => animation.cancel(), 500) * ``` * @public */ cancel() { if (this.playStateValue !== "running") { return; } this.driver.cancel(); if (this.playState !== "idle") { const reason = "AbortError"; this.finishedReject && this.finishedReject(reason); } this.playStateValue = "idle"; } /** * @internal */ finish() { if (this.playStateSource === "running") { this.playStateValue = "finished"; this.driver.finish(); } } /** * @internal */ isFinished() { return this.playStateValue === "finished"; } }; // ../../library/src/animation/Motion/autoValueHandlers.ts var correctBorderScale = (axis) => ({ correct: (latest, { delta, treeScale }) => { if (typeof latest === "string") latest = parseFloat(latest); if (latest === 0) return "0px"; let corrected = latest; if (delta && treeScale) { corrected = Math.round(latest / delta[axis].scale / treeScale[axis]); corrected = Math.max(corrected, 1); } return corrected + "px"; } }); // ../../library/src/animation/Motion/MotionSetup.tsx import { Fragment, jsx } from "react/jsx-runtime"; addScaleCorrector({ borderTopWidth: correctBorderScale("y"), borderLeftWidth: correctBorderScale("x"), borderRightWidth: correctBorderScale("x"), borderBottomWidth: correctBorderScale("y") }); function MotionSetup({ children }) { return /* @__PURE__ */ jsx(Fragment, { children }); } // ../../library/src/animation/Motion/startAnimation.ts function startAnimation(_key, value, target, transition = {}) { warnOnce( `"startAnimation" is unsupported. Use "animate" instead: https://www.framer.com/api/motion/utilities/#animate` ); return new Promise((resolve) => { animate(value, target, { ...transition, onComplete: () => resolve() }); }); } // ../../library/src/animation/animate.ts function deprecatedAnimate(from, to, animator, options) { deprecationWarning("animate()", "2.0.0", "the new animation API (https://www.framer.com/api/animation/)"); const target = from; let fromValue; if (isAnimatable(from) || isMotionValue2(from)) { fromValue = from.get(); } else { fromValue = Animatable.objectToValues(from); } const animation = new FramerAnimation(target, fromValue, to, animator, options); animation.play(); return animation; } var animate2 = /* @__PURE__ */ (() => { function animate3(from, to, animatorOrTransition, options) { return isAnimatable(from) ? deprecatedAnimate(from, to, animatorOrTransition, options) : animate(from, to, animatorOrTransition); } animate3.spring = (from, to, options) => { return animate3(from, to, SpringAnimator, options); }; animate3.bezier = (from, to, options) => { return animate3(from, to, BezierAnimator, options); }; animate3.linear = (from, to, options) => { return animate3.bezier(from, to, { ...options, curve: "linear" /* Linear */ }); }; animate3.ease = (from, to, options) => { return animate3.bezier(from, to, { ...options, curve: "ease" /* Ease */ }); }; animate3.easeIn = (from, to, options) => { return animate3.bezier(from, to, { ...options, curve: "ease-in" /* EaseIn */ }); }; animate3.easeOut = (from, to, options) => { return animate3.bezier(from, to, { ...options, curve: "ease-out" /* EaseOut */ }); }; animate3.easeInOut = (from, to, options) => { return animate3.bezier(from, to, { ...options, curve: "ease-in-out" /* EaseInOut */ }); }; return animate3; })(); // ../../library/src/components/AnimateLayout/LayoutIdContext.tsx import React14, { useCallback as useCallback4, useContext as useContext2, useMemo, useRef as useRef3 } from "react"; // ../../library/src/utils/assert.ts function assert(condition, ...msg) { var _a, _b; if (condition) return; const e = Error("Assertion Error" + (msg.length > 0 ? ": " + msg.join(" ") : "")); if (e.stack) { try { const lines = e.stack.split("\n"); if ((_a = lines[1]) == null ? void 0 : _a.includes("assert")) { lines.splice(1, 1); e.stack = lines.join("\n"); } else if ((_b = lines[0]) == null ? void 0 : _b.includes("assert")) { lines.splice(0, 1); e.stack = lines.join("\n"); } } catch { } } throw e; } function assertNever(x, error) { throw error || new Error(x ? `Unexpected value: ${x}` : "Application entered invalid state"); } // ../../library/src/components/AnimateLayout/LayoutIdContext.tsx import { Fragment as Fragment2, jsx as jsx2 } from "react/jsx-runtime"; var LayoutIdContext = /* @__PURE__ */ React14.createContext({ getLayoutId: (args) => null, persistLayoutIdCache: () => { }, top: false, enabled: true }); function LayoutIdProvider({ children }) { const context = useContext2(LayoutIdContext); if (context.top) return /* @__PURE__ */ jsx2(Fragment2, { children }); const cache2 = useRef3({ // When we provide a layoutId for a node based on it's first // duplicatedFrom id, we save it's layoutId mapped to it's actual id. // Future screen's nodes will check this cache first, to see if they've // previously been assigned a layoutId, or if any of there other // duplicatedFrom ids matched a node that was previously assigned a // layoutId. byId: {}, byName: {}, // When we navigate from screens that were duplicated from a future // screen, to that future screen, we want to do a reverse lookup on the // last duplicatedFrom id, rather than the id. We need to keep them // separate so they don't overlap. byLastId: {}, byPossibleId: {}, byLastName: {}, byLayoutId: {}, // When we don't have a cached layoutId for all duplicatedFrom ids, we // need to increment and save it so that we don't create clashing // layoutIds. We also need to reset name counts between screens, so we // record those separately. count: { byId: {}, byName: {} } }); const screen = useRef3({ byId: {}, byName: {}, byLastId: {}, byPossibleId: {}, byLastName: {}, byLayoutId: {} }); const usedIds = useRef3(/* @__PURE__ */ new Set()).current; const getLayoutId = useCallback4(({ id, name, duplicatedFrom }) => { if (!id) return null; const cacheKey = name ? "byName" : "byId"; const previousId = cache2.current[cacheKey][id]; if (previousId) return previousId; const nodeIdentifier = name || id; if (!duplicatedFrom && !usedIds.has(nodeIdentifier) && (!cache2.current.byLayoutId[nodeIdentifier] || cache2.current.byLayoutId[nodeIdentifier] === nodeIdentifier)) { if (cache2.current.count[cacheKey][nodeIdentifier] === void 0) { cache2.current.count[cacheKey][nodeIdentifier] = 0; cache2.current.byLayoutId[nodeIdentifier] = nodeIdentifier; screen.current[cacheKey][id] = nodeIdentifier; } usedIds.add(nodeIdentifier); return nodeIdentifier; } let possibleMatch = void 0; if (duplicatedFrom == null ? void 0 : duplicatedFrom.length) { for (let index = duplicatedFrom.length - 1; index >= 0; index--) { const duplicatedId = duplicatedFrom[index]; assert(!!duplicatedId, `duplicatedId must be defined`); const match = cache2.current[cacheKey][duplicatedId]; const byLastIdMatch = cache2.current.byLastId[duplicatedId]; if (byLastIdMatch && !possibleMatch) { const matchedLayoutId = cache2.current.byLayoutId[byLastIdMatch]; const shouldUseNamedLastIdMatch = !matchedLayoutId || matchedLayoutId === name; if (byLastIdMatch && !usedIds.has(byLastIdMatch) && (name ? shouldUseNamedLastIdMatch : true)) { possibleMatch = [byLastIdMatch, duplicatedId]; } } const previousLayoutId = match ? cache2.current.byLayoutId[match] : void 0; const shouldUseNamedMatch = !previousLayoutId || previousLayoutId === name; if (match && !usedIds.has(match) && (name ? shouldUseNamedMatch : true)) { screen.current[cacheKey][id] = match; screen.current.byLastId[duplicatedId] = match; usedIds.add(match); return match; } } } const last = cache2.current.byLastId[id]; if (last && !usedIds.has(last)) { usedIds.add(last); screen.current.byId[id] = last; return last; } if (possibleMatch) { const [match, duplicatedId] = possibleMatch; screen.current[cacheKey][id] = match; screen.current.byLastId[duplicatedId] = match; usedIds.add(match); return match; } const possible = cache2.current.byPossibleId[id]; if (possible && !usedIds.has(possible)) { usedIds.add(possible); screen.current.byId[id] = possible; return possible; } const rootDuplicatedId = duplicatedFrom == null ? void 0 : duplicatedFrom[0]; const identifier = name || rootDuplicatedId || id; const value = (cache2.current.count[cacheKey][identifier] ?? -1) + 1; const { layoutId, value: nextValue } = nextLayoutId(identifier, value, usedIds); cache2.current.count[cacheKey][identifier] = nextValue; screen.current[cacheKey][id] = layoutId; if (duplicatedFrom == null ? void 0 : duplicatedFrom.length) { if (!name) { const lastId = duplicatedFrom[duplicatedFrom.length - 1]; if (lastId) { screen.current.byLastId[lastId] = layoutId; } if (duplicatedFrom.length > 1) { for (let index = 0; index < duplicatedFrom.length - 1; index++) { const possibleId=d uplicatedFrom[index]; if (possibleId===v oid 0) continue; if (!screen.current.byPossibleId[possibleId]) { screen.current.byPossibleId[possibleId]=l ayoutId; } } } } } screen.current.byLayoutId[layoutId]=n odeIdentifier; usedIds.add(layoutId); return layoutId; }, []); const persistLayoutIdCache=u seCallback4(()=> { cache2.current = { byId: { ...cache2.current.byId, ...screen.current.byId }, byLastId: { ...cache2.current.byLastId, ...screen.current.byLastId }, byPossibleId: { ...cache2.current.byPossibleId, ...screen.current.byPossibleId }, byName: { ...cache2.current.byName, ...screen.current.byName }, byLastName: { ...cache2.current.byLastName, ...screen.current.byLastName }, byLayoutId: { ...cache2.current.byLayoutId, ...screen.current.byLayoutId }, // Unlike the count.byId, we need to reset the count.byName because // named layers might not have duplicatedFrom ids (e.g. imported // from Figma). When we can use duplicatedFrom ids to check if an id // was assigned on a previous screen, we don't increment the count, // which means that the count only increments for new items, and // only increments on a new screen if the node is new. Since named // layers need to always match in some way between screens, we reset // the count so that the second named layer on a second screen is // always name-1 if it doesn't have any duplicatedFrom ids. count: { ...cache2.current.count, byName: {} } }; screen.current = { byId: {}, byName: {}, byLastId: {}, byPossibleId: {}, byLastName: {}, byLayoutId: {} }; usedIds.clear(); }, []); const contextValue = useRef3({ getLayoutId, persistLayoutIdCache, top: true, enabled: true }).current; return /* @__PURE__ */ jsx2(LayoutIdContext.Provider, { value: contextValue, children }); } function nextLayoutId(identifier, initialValue, usedIds) { let value = initialValue; let layoutId = value ? `${identifier}-${value}` : identifier; while (usedIds.has(layoutId)) { value++; layoutId = `${identifier}-${value}`; } return { layoutId, value }; } function AutomaticLayoutIds({ enabled = true, ...props }) { const context = useContext2(LayoutIdContext); const contextValue = useMemo(() => { return { ...context, enabled }; }, [enabled]); return /* @__PURE__ */ jsx2(LayoutIdContext.Provider, { ...props, value: contextValue }); } // ../../library/src/components/Device/Device.tsx import React15, { Component as Component3 } from "react"; // ../../library/src/components/utils/useConstant.ts import { useRef as useRef4 } from "react"; function useConstant(init) { const ref = useRef4(null); if (ref.current === null) { ref.current = init(); } return ref.current; } // ../../library/src/components/Device/ErrorPlaceholder.tsx import { jsx as jsx3, jsxs } from "react/jsx-runtime"; var baseStyle = { background: void 0, display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "center", lineHeight: "1.4em", textOverflow: "ellipsis", overflow: "hidden", minHeight: 0, width: "100%", height: "100%" }; var errorStyle = /* @__PURE__ */ (() => ({ ...baseStyle, border: "1px solid rgba(149, 149, 149, 0.15)", borderRadius: 6, fontSize: "12px", backgroundColor: "rgba(149, 149, 149, 0.1)", color: "#a5a5a5" }))(); var textStyle = { overflow: "hidden", whiteSpace: "nowrap", textOverflow: "ellipsis", maxWidth: "100%", flexShrink: 0, padding: `0 10px` }; var titleStyle = /* @__PURE__ */ (() => ({ ...textStyle, // TODO: Use Fresco tokens for this. fontWeight: 500 }))(); var messageStyle = /* @__PURE__ */ (() => ({ ...textStyle, whiteSpace: "pre", maxHeight: "calc(50% - calc(20px * var(--framerInternalCanvas-canvasPlaceholderContentScaleFactor, 1)))", WebkitMaskImage: "linear-gradient(to bottom, black 80%, transparent 100%)" }))(); function ErrorPlaceholder(props) { const { error, file } = props; const title = file ? `Error in ${stripSlash(file)}` : "Error"; const message = error instanceof Error ? error.message : "" + error; return /* @__PURE__ */ jsxs("div", { style: errorStyle, children: [ /* @__PURE__ */ jsx3("div", { className: "text", style: titleStyle, children: title }), message && /* @__PURE__ */ jsx3("div", { className: "text", style: messageStyle, children: message }) ] }); } function stripSlash(title) { if (title.startsWith("./")) { return title.replace("./", ""); } return title; } // ../../library/src/components/Device/Device.tsx import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime"; function getScaleData(deviceOptions, containerSize) { const { componentWidth, componentHeight } = getComponentSize(deviceOptions); const scaleX = containerSize.width / componentWidth; const scaleY = containerSize.height / componentHeight; const scale = Math.min(scaleX, scaleY, 1); let screenScalePixelFix = 1; if (scale < 1) { const actualScreenWidth=d eviceOptions.screenWidth * scale; const desiredScreenWidth=a ctualScreenWidth + 1; const screenScaleX=d esiredScreenWidth / actualScreenWidth; const actualScreenHeight=d eviceOptions.screenHeight * scale; const desiredScreenHeight=a ctualScreenHeight + 1; const screenScaleY=d esiredScreenHeight / actualScreenHeight; const screenScale=M ath.max(screenScaleX, screenScaleY); screenScalePixelFix=s creenScale; } return { scale, screenScalePixelFix, scaledComponentWidth: componentWidth * scale, scaledComponentHeight: componentHeight * scale, scaledDeviceWidth: deviceOptions.deviceWidth * scale, scaledDeviceHeight: deviceOptions.deviceHeight * scale }; } function getColorsFromTheme(theme, type) { if (type==="none" ) return {}; if (!theme) return {}; const isDarkTheme=t heme==="dark" ; return { shadowColor: isDarkTheme ? "rgba(0, 0, 0, 0.55)" : "rgba(0, 0, 0, 0.15)", bezelColor: isDarkTheme ? "#222" : "#fff", bezelShadeColor: isDarkTheme ? "#000" : "rgba(0, 0, 0, 0.2)", screenColor: isDarkTheme ? "#333" : "#eee" }; } var ErrorBoundary2=c lass extends Component3 { constructor() { super(...arguments); __publicField(this, "state", {}); } componentDidCatch(error, info) { var _a; let stack=( _a=i nfo.componentStack)==n ull ? void 0 : _a.split( "\n").filter((line)=> line.length !== 0); let currentIndex = 0; if (stack) { for (const line of stack) { if (line.startsWith(` in ${this.constructor.name}`)) { break; } currentIndex++; } stack = stack.slice(0, currentIndex); } this.setState({ lastError: { error, componentStack: stack } }); } componentDidUpdate(_, prevState) { if (this.state.lastError === void 0) return; if (prevState.lastError === this.state.lastError) this.setState({ lastError: void 0 }); } render() { if (this.state.lastError) { return /* @__PURE__ */ jsx4(ErrorPlaceholder, { error: this.state.lastError.error.message, file: "Prototype" }); } return this.props.children; } }; function Device({ canResize = false, children, ResizeObserver = safeWindow.ResizeObserver, ...options }) { var _a, _b; const optionsRef = React15.useRef(void 0); if (optionsRef.current === void 0) optionsRef.current = options; const deviceAppearance = (_a = options.deviceOptions) == null ? void 0 : _a.appearance.type; const scaleDataRef = React15.useRef(); const containerRef = React15.useRef(null); const deviceRef = React15.useRef(null); const screenRef = React15.useRef(null); const updateImperativeScale = ({ scale, screenScalePixelFix }) => { if (!scaleDataRef.current || !deviceRef.current || !screenRef.current) return; deviceRef.current.style.transform = `scale(${scale})`; screenRef.current.style.transform = `scale(${screenScalePixelFix})`; }; if (scaleDataRef.current === void 0 && options.deviceOptions && options.scaleTo && options.scaleTo !== "dynamic") { const scale = scaleDataRef.current = getScaleData(options.deviceOptions, options.scaleTo); updateImperativeScale(scale); } const invertScale = React15.useCallback( (point) => { if (!scaleDataRef.current) return point; const { scale = 1 } = scaleDataRef.current; return { x: point.x / scale, y: point.y / scale }; }, [scaleDataRef] ); const updateScale = React15.useCallback(() => { const { deviceOptions, scaleTo, onScaleChange } = optionsRef.current ?? {}; if (!deviceOptions || !scaleTo || scaleTo !== "dynamic" || !containerRef.current) return; if (containerRef.current.offsetWidth === 0 || containerRef.current.offsetHeight === 0) return; const scaleData = scaleDataRef.current = getScaleData(deviceOptions, { width: containerRef.current.offsetWidth, height: containerRef.current.offsetHeight }); onScaleChange == null ? void 0 : onScaleChange(scaleData); updateImperativeScale(scaleData); }, []); const observer = useConstant(() => { if (!ResizeObserver) { return; } return new ResizeObserver(() => updateScale()); }); React15.useLayoutEffect(() => { optionsRef.current = { deviceOptions: options.deviceOptions, onScaleChange: options.onScaleChange, overrideTheme: options.overrideTheme, scaleTo: options.scaleTo }; }, [options.deviceOptions, options.onScaleChange, options.overrideTheme, options.scaleTo]); React15.useLayoutEffect(() => { updateScale(); }, [updateScale]); React15.useEffect(() => { if (!observer || !containerRef.current) return; observer.observe(containerRef.current); return () => observer.disconnect(); }, [observer]); const { containerStyle, handStyle, deviceStyle, deviceImageStyle, screenStyle } = getDeviceStyle(options); const resizeStyles = canResize ? { display: "flex", justifyContent: "center", alignItems: "center", height: "100%" } : {}; const screenBackground = ((_b = options.deviceOptions) == null ? void 0 : _b.transparentBackground) ? "transparent" : "white"; return /* @__PURE__ */ jsx4("div", { style: { ...containerStyle, ...resizeStyles }, ref: containerRef, children: /* @__PURE__ */ jsxs2("div", { style: { ...deviceStyle }, ref: deviceRef, children: [ handStyle && /* @__PURE__ */ jsx4("div", { style: handStyle }), deviceAppearance === "external-clay" && deviceImageStyle && /* @__PURE__ */ jsx4("div", { style: deviceImageStyle }), /* @__PURE__ */ jsx4( "div", { style: { ...screenStyle, pointerEvents: void 0, backgroundColor: children ? screenBackground : screenStyle.backgroundColor }, ref: screenRef, children: /* @__PURE__ */ jsx4(MotionConfig, { transformPagePoint: invertScale, children: /* @__PURE__ */ jsx4(ErrorBoundary2, { children }) }) } ), deviceAppearance === "realistic" && deviceImageStyle && /* @__PURE__ */ jsx4("div", { style: deviceImageStyle }) ] }) }); } var DEVICE_PADDING = 45; var HAND_IMG_WIDTH = 2400; var HAND_IMG_HEIGHT = 3740; var HAND_IMG_GAP_WIDTH = 859; var HAND_IMG_GAP_LEFT = 772; var HAND_IMG_GAP_BOTTOM = /* @__PURE__ */ (() => 992 - 5)(); var noDeviceSize = { componentWidth: 500, componentHeight: 500 }; function getComponentSize(options) { if (!options) return noDeviceSize; const { deviceWidth, deviceHeight, noPadding } = options; const padding = noPadding ? 0 : DEVICE_PADDING * 2; return { componentWidth: deviceWidth + padding, componentHeight: deviceHeight + padding }; } function getDeviceStyle({ scaleTo, deviceOptions, overrideTheme } = {}) { const noDeviceStyle = { containerStyle: {}, deviceStyle: {}, screenStyle: {} }; if (!deviceOptions) return noDeviceStyle; const { componentWidth, componentHeight } = getComponentSize(deviceOptions); const overriddenColors = getColorsFromTheme(overrideTheme, deviceOptions.appearance.type); const { deviceWidth, deviceHeight, appearance, screenWidth, screenHeight, screenMaxHeight, screenOffsetTop, screenOffsetLeft, screenRadius, screenMaskImage, screenColor, shadow, background, hand } = deviceOptions; const boxShadows = []; if (appearance.type === "clay" && shadow) { boxShadows.push(shadow); } let bezelStyle = void 0; if (appearance.type === "clay") { bezelStyle = { borderRadius: appearance.bezelRadius, backgroundColor: overriddenColors.bezelColor || appearance.bezelColor }; if (overriddenColors.bezelShadeColor || appearance.bezelShadeColor) { boxShadows.push(`inset 0 0 15px ${overriddenColors.bezelShadeColor || appearance.bezelShadeColor}`); } } const handOffsetLeft = (hand == null ? void 0 : hand.offsetLeft) ?? 0; const handOffsetRight = (hand == null ? void 0 : hand.offsetRight) ?? 0; const handOffsetBottom = (hand == null ? void 0 : hand.offsetBottom) ?? 0; const handScale = (deviceWidth - handOffsetLeft - handOffsetRight) / HAND_IMG_GAP_WIDTH; return { containerStyle: { width: scaleTo ? "100%" : componentWidth, height: scaleTo ? "100%" : componentHeight, flex: "1 1 0", display: "flex", alignItems: "center", justifyContent: "center", overflow: "hidden", background }, handStyle: hand && { width: HAND_IMG_WIDTH * handScale, height: HAND_IMG_HEIGHT * handScale, position: "absolute", pointerEvents: "none", backgroundImage: `url("${hand.imageUrl}")`, backgroundSize: "contain", backgroundRepeat: "no-repeat", left: -HAND_IMG_GAP_LEFT * handScale + handOffsetLeft, bottom: -HAND_IMG_GAP_BOTTOM * handScale + handOffsetBottom }, deviceStyle: { width: deviceWidth, height: deviceHeight, flexShrink: 0, position: "absolute", boxShadow: boxShadows.join(","), ...bezelStyle }, deviceImageStyle: appearance.type === "realistic" || appearance.type === "external-clay" ? { width: appearance.imageWidth, height: appearance.imageHeight, position: "absolute", pointerEvents: "none", overflow: "hidden", backgroundImage: `url("${appearance.imageUrl}")`, backgroundPosition: "top left", backgroundRepeat: "no-repeat", backgroundSize: `${appearance.imageWidth}px ${appearance.imageHeight}px`, // Rotate 90 degrees counter-clockwise around (0,0), then move the // result down into the viewport (rightmost transform is applied first). transformOrigin: "top left", transform: appearance.rotateImage ? `translateY(${appearance.imageWidth}px) rotate(-90deg)` : void 0 } : void 0, screenStyle: { width: screenWidth, height: screenHeight, maxHeight: screenMaxHeight, position: "absolute", top: screenOffsetTop, left: screenOffsetLeft, display: "flex", alignItems: "center", justifyContent: "center", overflow: "hidden", borderRadius: screenRadius, backgroundColor: overriddenColors.screenColor || screenColor, ...screenMaskImage && { maskImage: screenMaskImage, WebkitMaskImage: screenMaskImage, maskSize: "contain", WebkitMaskSize: "contain" } } }; } // ../../library/src/components/Device/DeviceCodeComponent.tsx import React18 from "react"; // ../../library/src/render/types/NewConstraints.tsx import React16 from "react"; // ../../library/src/render/utils/isFiniteNumber.ts function isFiniteNumber(value) { return typeof value === "number" && isFinite(value); } function finiteNumber(value) { return isFiniteNumber(value) ? value : void 0; } // ../../library/src/utils/type-guards.ts function isEmpty(obj) { return !obj || !Object.keys(obj).length && obj.constructor === Object; } function isReactElement(test) { return typeof test !== "string" && typeof test !== "number"; } function isReactChild(test) { return test !== null && typeof test !== "undefined" && typeof test !== "boolean" && !isEmpty(test); } // ../../library/src/render/utils/degreesToRadians.ts function degreesToRadians(degrees) { return degrees * (Math.PI / 180); } // ../../library/src/render/types/Line.ts var Line = /* @__PURE__ */ (() => { function Line2(a, b) { return { a, b }; } Line2.offset = (line, offset) => { const angle = Point.angleFromX(line.a, line.b); const rad = degreesToRadians(angle); const x = offset * Math.sin(rad); const y = offset * Math.cos(rad); return Line2( { x: line.a.x + x, y: line.a.y - y }, { x: line.b.x + x, y: line.b.y - y } ); }; Line2.intersection = (lineA, lineB, segments) => { const x1 = lineA.a.x; const y1 = lineA.a.y; const x2 = lineA.b.x; const y2 = lineA.b.y; const x3 = lineB.a.x; const y3 = lineB.a.y; const x4 = lineB.b.x; const y4 = lineB.b.y; const a1 = (x4 - x3) * (y3 - y1) - (y4 - y3) * (x3 - x1); const b1 = (x4 - x3) * (y2 - y1) - (y4 - y3) * (x2 - x1); const c1 = (x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1); if (a1 === 0 && b1 === 0) return null; if (b1 === 0) return null; const alpha = a1 / b1; const beta = c1 / b1; if (segments && (alpha < 0 || alpha> 1 || beta < 0 || beta> 1)) return null; return { x: x1 + alpha * (x2 - x1), y: y1 + alpha * (y2 - y1) }; }; Line2.intersectionAngle = (lineA, lineB) => { const deltaAX = lineA.b.x - lineA.a.x; const deltaAY = lineA.b.y - lineA.a.y; const deltaBX = lineB.b.x - lineB.a.x; const deltaBY = lineB.b.y - lineB.a.y; const angle = Math.atan2(deltaAX * deltaBY - deltaAY * deltaBX, deltaAX * deltaBX + deltaAY * deltaBY); return angle * (180 / Math.PI); }; Line2.isOrthogonal = (line) => { return line.a.x === line.b.x || line.a.y === line.b.y; }; Line2.perpendicular = (line, pointOnLine) => { const deltaX = line.a.x - line.b.x; const deltaY = line.a.y - line.b.y; const pointB = Point(pointOnLine.x - deltaY, pointOnLine.y + deltaX); return Line2(pointB, pointOnLine); }; Line2.projectPoint = (line, point) => { const perp = Line2.perpendicular(line, point); return Line2.intersection(line, perp); }; Line2.pointAtPercentDistance = (line, distance2) => { const hypotenuse = Line2.distance(line); const r = distance2 * hypotenuse / hypotenuse; return { x: r * line.b.x + (1 - r) * line.a.x, y: r * line.b.y + (1 - r) * line.a.y }; }; Line2.distance = (line) => { return Point.distance(line.a, line.b); }; return Line2; })(); // ../../library/src/render/types/Rect.ts var Rect = { /** * * @param rect - * @param other - * @returns if the input rectangles are equal in size and position * @public */ equals: function(rect, other) { if (rect === other) return true; if (!rect || !other) return false; return rect.x === other.x && rect.y === other.y && rect.width === other.width && rect.height === other.height; }, /** @internal */ atOrigin: (size) => { return { ...size, x: 0, y: 0 }; }, /** @internal */ fromTwoPoints: (a, b) => { return { x: Math.min(a.x, b.x), y: Math.min(a.y, b.y), width: Math.abs(a.x - b.x), height: Math.abs(a.y - b.y) }; }, /** @internal */ fromRect: (rect) => { return { x: rect.left, y: rect.top, width: rect.right - rect.left, height: rect.bottom - rect.top }; }, /** @internal */ multiply: (rect, n) => { return { x: rect.x * n, y: rect.y * n, width: rect.width * n, height: rect.height * n }; }, /** @internal */ divide: (rect, n) => { return Rect.multiply(rect, 1 / n); }, /** @internal */ offset: (rect, delta) => { const xOffset = typeof delta.x === "number" ? delta.x : 0; const yOffset = typeof delta.y === "number" ? delta.y : 0; return { ...rect, x: rect.x + xOffset, y: rect.y + yOffset }; }, /** @internal */ inflate: (rect, value) => { if (value === 0) return rect; const doubleValue = 2 * value; return { x: rect.x - value, y: rect.y - value, width: rect.width + doubleValue, height: rect.height + doubleValue }; }, /** @internal */ pixelAligned: (rect) => { const x = Math.round(rect.x); const y = Math.round(rect.y); const rectMaxX = Math.round(rect.x + rect.width); const rectMaxY = Math.round(rect.y + rect.height); const width = Math.max(rectMaxX - x, 0); const height = Math.max(rectMaxY - y, 0); return { x, y, width, height }; }, /** @internal */ halfPixelAligned: (rect) => { const x = Math.round(rect.x * 2) / 2; const y = Math.round(rect.y * 2) / 2; const rectMaxX = Math.round((rect.x + rect.width) * 2) / 2; const rectMaxY = Math.round((rect.y + rect.height) * 2) / 2; const width = Math.max(rectMaxX - x, 1); const height = Math.max(rectMaxY - y, 1); return { x, y, width, height }; }, /** @internal */ round: (rect, decimals = 0) => { const x = roundedNumber(rect.x, decimals); const y = roundedNumber(rect.y, decimals); const width = roundedNumber(rect.width, decimals); const height = roundedNumber(rect.height, decimals); return { x, y, width, height }; }, /** @internal */ roundToOutside: (rect) => { const x = Math.floor(rect.x); const y = Math.floor(rect.y); const rectMaxX = Math.ceil(rect.x + rect.width); const rectMaxY = Math.ceil(rect.y + rect.height); const width = Math.max(rectMaxX - x, 0); const height = Math.max(rectMaxY - y, 0); return { x, y, width, height }; }, /** * @param rect - * @internal */ minX: (rect) => { return rect.x; }, /** * @param rect - * @internal */ maxX: (rect) => { return rect.x + rect.width; }, /** * @param rect - * @internal */ minY: (rect) => { return rect.y; }, /** * @param rect - * @internal */ maxY: (rect) => { return rect.y + rect.height; }, /** @internal */ positions: (rect) => { return { minX: rect.x, midX: rect.x + rect.width / 2, maxX: Rect.maxX(rect), minY: rect.y, midY: rect.y + rect.height / 2, maxY: Rect.maxY(rect) }; }, /** * * @param rect - * @internal */ center: (rect) => { return { x: rect.x + rect.width / 2, y: rect.y + rect.height / 2 }; }, /** @internal */ boundingRectFromPoints: (ps) => { let minX = Infinity; let maxX = -Infinity; let minY = Infinity; let maxY = -Infinity; for (let i = 0; i < ps.length; i++) { const point=p s[i]; minX=M ath.min(minX, point.x); maxX=M ath.max(maxX, point.x); minY=M ath.min(minY, point.y); maxY=M ath.max(maxY, point.y); } return { x: minX, y: minY, width: maxX - minX, height: maxY - minY }; }, /** * Returns the precise box defined by the given points, starting from the top-left point. This produces the same * Rect as Rect.boundingRectFromPoints *only* when the rect described by the points is not rotated. * * @internal */ fromPoints: (ps)=> { const [tl, tr, _, bl] = ps; const { x, y } = tl; const width = Point.distance(tl, tr); const height = Point.distance(tl, bl); return { x, y, width, height }; }, /** * Returns a rect containing all input rects * @param rect - a list of rectangles * @returns A rectangle that fits exactly around the input rects * @internal */ merge: (...rect) => { const min = { x: Math.min(...rect.map(Rect.minX)), y: Math.min(...rect.map(Rect.minY)) }; const max = { x: Math.max(...rect.map(Rect.maxX)), y: Math.max(...rect.map(Rect.maxY)) }; return Rect.fromTwoPoints(min, max); }, /** @internal */ intersection: (rect1, rect2) => { const x = Math.max(rect1.x, rect2.x); const x2 = Math.min(rect1.x + rect1.width, rect2.x + rect2.width); const y = Math.max(rect1.y, rect2.y); const y2 = Math.min(rect1.y + rect1.height, rect2.y + rect2.height); return { x, y, width: x2 - x, height: y2 - y }; }, /** * Returns all the corner points for a rect * @param rect - * @internal */ points: (rect) => { return [ { x: Rect.minX(rect), y: Rect.minY(rect) }, { x: Rect.minX(rect), y: Rect.maxY(rect) }, { x: Rect.maxX(rect), y: Rect.minY(rect) }, { x: Rect.maxX(rect), y: Rect.maxY(rect) } ]; }, /** * Returns all the corner points for a rect at the origin. * @internal */ pointsAtOrigin: (rect) => { return [ { x: 0, y: 0 }, { x: rect.width, y: 0 }, { x: rect.width, y: rect.height }, { x: 0, y: rect.height } ]; }, /** Takes a rect and transforms it by a matrix, resulting in the bounding rectangle of the * rotated and/or translated original. * @param rect - rectangle to transform * @param matrix - matrix to transform by * @returns The bounding rectangle of the rotated and/or translated rect. */ transform: (rect, matrix) => { const { x: x1, y: y1 } = matrix.transformPoint({ x: rect.x, y: rect.y }); const { x: x2, y: y2 } = matrix.transformPoint({ x: rect.x + rect.width, y: rect.y }); const { x: x3, y: y3 } = matrix.transformPoint({ x: rect.x + rect.width, y: rect.y + rect.height }); const { x: x4, y: y4 } = matrix.transformPoint({ x: rect.x, y: rect.y + rect.height }); const x = Math.min(x1, x2, x3, x4); const width = Math.max(x1, x2, x3, x4) - x; const y = Math.min(y1, y2, y3, y4); const height = Math.max(y1, y2, y3, y4) - y; return { x, y, width, height }; }, /** * Checks if a rectangle contains a point * @param rect - The rectangle to check * @param point - The point to check * @returns true if the provided rectangle contains the provided point * @internal */ containsPoint: (rect, point) => { if (point.x < Rect.minX(rect)) { return false; } if (point.x> Rect.maxX(rect)) { return false; } if (point.y < Rect.minY(rect)) { return false; } if (point.y> Rect.maxY(rect)) { return false; } if (isNaN(rect.x)) { return false; } if (isNaN(rect.y)) { return false; } return true; }, /** * Returns wether a rect contains another rect entirely * @param rectA - * @param rectB - * @returns true if rectA contains rectB */ containsRect: (rectA, rectB) => { for (const point of Rect.points(rectB)) { if (!Rect.containsPoint(rectA, point)) { return false; } } return true; }, /** @internal */ toCSS: (rect) => { return { display: "block", transform: `translate(${rect.x}px, ${rect.y}px)`, width: `${rect.width}px`, height: `${rect.height}px` }; }, /** @internal */ inset: (rect, n) => { return { x: rect.x + n, y: rect.y + n, width: Math.max(0, rect.width - 2 * n), height: Math.max(0, rect.height - 2 * n) }; }, /** @internal */ intersects: (rectA, rectB) => { return !(rectB.x >= Rect.maxX(rectA) || Rect.maxX(rectB) <=r ectA.x || rectB.y>= Rect.maxY(rectA) || Rect.maxY(rectB) <=r ectA.y); }, /** @internal */ overlapHorizontally: (rectA, rectB)=> { const aMax = Rect.maxX(rectA); const bMax = Rect.maxX(rectB); return aMax > rectB.x && bMax > rectA.x; }, /** @internal */ overlapVertically: (rectA, rectB) => { const aMax = Rect.maxY(rectA); const bMax = Rect.maxY(rectB); return aMax > rectB.y && bMax > rectA.y; }, /** @internal */ doesNotIntersect: (rect, rects) => { return rects.find((comparingRect) => { return Rect.intersects(comparingRect, rect); }) === void 0; }, /** * * @param rectA - * @param rectB - * @returns if the input rectangles are equal in size and position * @public * @deprecated: please use Rect.equals instead */ isEqual: (rectA, rectB) => { return Rect.equals(rectA, rectB); }, // @TODO: duplicate of points() /** * @returns [tl, tr, br, bl] * @internal */ cornerPoints: (rect) => { const rectMinX = rect.x; const rectMaxX = rect.x + rect.width; const rectMinY = rect.y; const rectMaxY = rect.y + rect.height; const corner1 = { x: rectMinX, y: rectMinY }; const corner2 = { x: rectMaxX, y: rectMinY }; const corner3 = { x: rectMaxX, y: rectMaxY }; const corner4 = { x: rectMinX, y: rectMaxY }; return [corner1, corner2, corner3, corner4]; }, /** @internal */ midPoints: (rect) => { const rectMinX = rect.x; const rectMidX = rect.x + rect.width / 2; const rectMaxX = rect.x + rect.width; const rectMinY = rect.y; const rectMidY = rect.y + rect.height / 2; const rectMaxY = rect.y + rect.height; const top = { x: rectMidX, y: rectMinY }; const right = { x: rectMaxX, y: rectMidY }; const bottom = { x: rectMidX, y: rectMaxY }; const left = { x: rectMinX, y: rectMidY }; return [top, right, bottom, left]; }, /** @internal */ pointDistance: (rect, point) => { let x = 0; let y = 0; if (point.x < rect.x) { x=r ect.x - point.x; } else if (point.x> Rect.maxX(rect)) { x = point.x - Rect.maxX(rect); } if (point.y < rect.y) { y=r ect.y - point.y; } else if (point.y> Rect.maxY(rect)) { y = point.y - Rect.maxY(rect); } return Point.distance({ x, y }, { x: 0, y: 0 }); }, /** @internal */ fromAny: (rect, defaults = { x: 0, y: 0, width: 0, height: 0 }) => { return { x: rect.x || defaults.x, y: rect.y || defaults.y, width: rect.width || defaults.width, height: rect.height || defaults.height }; }, delta: (a, b) => { const pointA = { x: Rect.minX(a), y: Rect.minY(a) }; const pointB = { x: Rect.minX(b), y: Rect.minY(b) }; return { x: pointA.x - pointB.x, y: pointA.y - pointB.y }; }, /** @internal */ withMinSize: (rect, minSize) => { const { width: minWidth, height: minHeight } = minSize; const diffX = rect.width - minWidth; const diffY = rect.height - minHeight; return { width: Math.max(rect.width, minWidth), height: Math.max(rect.height, minHeight), x: rect.width < minWidth ? rect.x + diffX / 2 : rect.x, y: rect.height < minHeight ? rect.y + diffY / 2 : rect.y }; }, /** * Return false if any point is not inside or on the provided rect. * @internal */ anyPointsOutsideRect: (rect, ps)=> { const rectMinX = Rect.minX(rect); const rectMinY = Rect.minY(rect); const rectMaxX = Rect.maxX(rect); const rectMaxY = Rect.maxY(rect); for (const point of ps) { if (point.x < rectMinX || point.x> rectMaxX) { return true; } if (point.y < rectMinY || point.y> rectMaxY) { return true; } } return false; }, /** @internal */ edges: (rect) => { const [tl, tr, br, bl] = Rect.cornerPoints(rect); return [Line(tl, tr), Line(tr, br), Line(br, bl), Line(bl, tl)]; }, /** * Return a new rect projected into a new position based on the anchor rect and the given direction/alignment. * @internal */ rebaseRectOnto: (rect, anchorRect, direction, alignment) => { const rebasedRect = { ...rect }; switch (direction) { case "bottom": case "top": switch (alignment) { case "start": rebasedRect.x = anchorRect.x; break; case "center": rebasedRect.x = anchorRect.x + anchorRect.width / 2 - rect.width / 2; break; case "end": rebasedRect.x = anchorRect.x + anchorRect.width - rect.width; break; default: assertNever(alignment); } break; case "left": rebasedRect.x = anchorRect.x - rect.width; break; case "right": rebasedRect.x = anchorRect.x + anchorRect.width; break; default: assertNever(direction); } switch (direction) { case "left": case "right": switch (alignment) { case "start": rebasedRect.y = anchorRect.y; break; case "center": rebasedRect.y = anchorRect.y + anchorRect.height / 2 - rect.height / 2; break; case "end": rebasedRect.y = anchorRect.y + anchorRect.height - rect.height; break; default: assertNever(alignment); } break; case "top": rebasedRect.y = anchorRect.y - rect.height; break; case "bottom": rebasedRect.y = anchorRect.y + anchorRect.height; break; default: assertNever(direction); } return rebasedRect; } }; // ../../library/src/render/types/Constraints.ts var constraintDefaults = { left: null, right: null, top: null, bottom: null, centerX: "50%", centerY: "50%", aspectRatio: null, parentSize: null, width: 100, height: 100 }; var DimensionType = /* @__PURE__ */ ((DimensionType2) => { DimensionType2[DimensionType2["FixedNumber"] = 0] = "FixedNumber"; DimensionType2[DimensionType2["Percentage"] = 1] = "Percentage"; DimensionType2[DimensionType2["Auto"] = 2] = "Auto"; DimensionType2[DimensionType2["FractionOfFreeSpace"] = 3] = "FractionOfFreeSpace"; DimensionType2[DimensionType2["Viewport"] = 4] = "Viewport"; return DimensionType2; })(DimensionType || {}); function isConstraintSupportingChild(child) { if (!isReactChild(child) || !isReactElement(child)) { return false; } return true; } var ConstraintMask = { // Modifies the constraint mask to remove invalid (mutually exclusive) options and returns the original. // TODO: this removes major inconsistencies but probably needs to be merged with ConstraintSolver. quickfix: (constraints) => { if (constraints.widthType === 2 /* Auto */ || constraints.heightType === 2 /* Auto */) { constraints.aspectRatio = null; } if (isFiniteNumber(constraints.aspectRatio)) { if (constraints.left && constraints.right) { constraints.widthType = 0 /* FixedNumber */; } if (constraints.top && constraints.bottom) { constraints.heightType = 0 /* FixedNumber */; } if (constraints.left && constraints.right && constraints.top && constraints.bottom) { constraints.bottom = false; } if (constraints.widthType !== 0 /* FixedNumber */ && constraints.heightType !== 0 /* FixedNumber */) { constraints.heightType = 0 /* FixedNumber */; } } if (constraints.left && constraints.right) { if (constraints.fixedSize || constraints.widthType === 2 /* Auto */ || isFiniteNumber(constraints.maxWidth)) { constraints.right = false; } constraints.widthType = 0 /* FixedNumber */; } if (constraints.top && constraints.bottom) { if (constraints.fixedSize || constraints.heightType === 2 /* Auto */ || isFiniteNumber(constraints.maxHeight)) { constraints.bottom = false; } constraints.heightType = 0 /* FixedNumber */; } return constraints; } }; function valueToDimensionType(value) { if (typeof value === "string") { const trimmedValue = value.trim(); if (trimmedValue === "auto") return 2 /* Auto */; if (trimmedValue.endsWith("fr")) return 3 /* FractionOfFreeSpace */; if (trimmedValue.endsWith("%")) return 1 /* Percentage */; if (trimmedValue.endsWith("vw") || trimmedValue.endsWith("vh")) return 4 /* Viewport */; } return 0 /* FixedNumber */; } var ConstraintValues = { // Returns concrete current values given some ConstraintProperties. fromProperties: (props) => { const { left, right, top, bottom, width, height, centerX, centerY, aspectRatio, autoSize } = props; const constraints = ConstraintMask.quickfix({ left: isFiniteNumber(left) || isAnimatable(left), right: isFiniteNumber(right) || isAnimatable(right), top: isFiniteNumber(top) || isAnimatable(top), bottom: isFiniteNumber(bottom) || isAnimatable(bottom), widthType: valueToDimensionType(width), heightType: valueToDimensionType(height), aspectRatio: aspectRatio || null, fixedSize: autoSize === true }); let widthValue = null; let heightValue = null; let widthType = 0 /* FixedNumber */; let heightType = 0 /* FixedNumber */; if (constraints.widthType !== 0 /* FixedNumber */ && typeof width === "string") { const parsedWidth = parseFloat(width); if (width.endsWith("fr")) { widthType = 3 /* FractionOfFreeSpace */; widthValue = parsedWidth; } else if (width === "auto") { widthType = 2 /* Auto */; } else { widthType = 1 /* Percentage */; widthValue = parsedWidth / 100; } } else if (width !== void 0 && typeof width !== "string") { widthValue = Animatable.getNumber(width); } if (constraints.heightType !== 0 /* FixedNumber */ && typeof height === "string") { const parsedHeight = parseFloat(height); if (height.endsWith("fr")) { heightType = 3 /* FractionOfFreeSpace */; heightValue = parsedHeight; } else if (height === "auto") { heightType = 2 /* Auto */; } else { heightType = 1 /* Percentage */; heightValue = parseFloat(height) / 100; } } else if (height !== void 0 && typeof height !== "string") { heightValue = Animatable.getNumber(height); } let centerAnchorX = 0.5; let centerAnchorY = 0.5; if (centerX) { centerAnchorX = parseFloat(centerX) / 100; } if (centerY) { centerAnchorY = parseFloat(centerY) / 100; } return { left: constraints.left ? Animatable.getNumber(left) : null, right: constraints.right ? Animatable.getNumber(right) : null, top: constraints.top ? Animatable.getNumber(top) : null, bottom: constraints.bottom ? Animatable.getNumber(bottom) : null, widthType, heightType, width: widthValue, height: heightValue, aspectRatio: constraints.aspectRatio || null, centerAnchorX, centerAnchorY }; }, toSize: (values, parentSizeInfo, autoSize, freeSpace) => { let width = null; let height = null; const parentWidth = (parentSizeInfo == null ? void 0 : parentSizeInfo.sizing) ? Animatable.getNumber(parentSizeInfo == null ? void 0 : parentSizeInfo.sizing.width) : null; const parentHeight = (parentSizeInfo == null ? void 0 : parentSizeInfo.sizing) ? Animatable.getNumber(parentSizeInfo == null ? void 0 : parentSizeInfo.sizing.height) : null; const hOpposingPinsOffset = pinnedOffset(values.left, values.right); if (parentWidth && isFiniteNumber(hOpposingPinsOffset)) { width = parentWidth - hOpposingPinsOffset; } else if (autoSize && values.widthType === 2 /* Auto */) { width = autoSize.width; } else if (isFiniteNumber(values.width)) { switch (values.widthType) { case 0 /* FixedNumber */: width = values.width; break; case 3 /* FractionOfFreeSpace */: width = freeSpace ? freeSpace.freeSpaceInParent.width / freeSpace.freeSpaceUnitDivisor.width * values.width : null; break; case 1 /* Percentage */: case 4 /* Viewport */: if (parentWidth) { width = parentWidth * values.width; } break; case 2 /* Auto */: break; default: assertNever(values.widthType); } } const vOpposingPinsOffset = pinnedOffset(values.top, values.bottom); if (parentHeight && isFiniteNumber(vOpposingPinsOffset)) { height = parentHeight - vOpposingPinsOffset; } else if (autoSize && values.heightType === 2 /* Auto */) { height = autoSize.height; } else if (isFiniteNumber(values.height)) { switch (values.heightType) { case 0 /* FixedNumber */: height = values.height; break; case 3 /* FractionOfFreeSpace */: height = freeSpace ? freeSpace.freeSpaceInParent.height / freeSpace.freeSpaceUnitDivisor.height * values.height : null; break; case 1 /* Percentage */: case 4 /* Viewport */: if (parentHeight) { height = parentHeight * values.height; } break; case 2 /* Auto */: break; default: assertNever(values.heightType); } } return sizeAfterApplyingConstraintsAndAspectRatio( width, height, values, { height: parentHeight ?? 0, width: parentWidth ?? 0 }, parentSizeInfo == null ? void 0 : parentSizeInfo.viewport ); }, // Returns a parent-relative rect given concrete ConstraintValues. toRect: (values, parentSizeInfo = null, autoSize = null, pixelAlign = false, freeSpace = null) => { let x = values.left || 0; let y = values.top || 0; const { width, height } = ConstraintValues.toSize(values, parentSizeInfo, autoSize, freeSpace); const parentSizeForPositioning = (parentSizeInfo == null ? void 0 : parentSizeInfo.positioning) ?? null; const positioningParentWidth = parentSizeForPositioning ? Animatable.getNumber(parentSizeForPositioning.width) : null; const positioningParentHeight = parentSizeForPositioning ? Animatable.getNumber(parentSizeForPositioning.height) : null; if (values.left !== null) { x = values.left; } else if (positioningParentWidth && values.right !== null) { x = positioningParentWidth - values.right - width; } else if (positioningParentWidth) { x = values.centerAnchorX * positioningParentWidth - width / 2; } if (values.top !== null) { y = values.top; } else if (positioningParentHeight && values.bottom !== null) { y = positioningParentHeight - values.bottom - height; } else if (positioningParentHeight) { y = values.centerAnchorY * positioningParentHeight - height / 2; } const f = { x, y, width, height }; if (pixelAlign) { return Rect.pixelAligned(f); } return f; } }; var defaultWidth = 200; var defaultHeight = 200; function getConstraintValue(constraint, value, parentSize, viewport) { if (typeof value === "string") { if (value.endsWith("%") && parentSize) { switch (constraint) { case "maxWidth": case "minWidth": return parseFloat(value) / 100 * parentSize.width; case "maxHeight": case "minHeight": return parseFloat(value) / 100 * parentSize.height; default: break; } } if (value.endsWith("vh") && viewport) { switch (constraint) { case "maxWidth": case "minWidth": return parseFloat(value) / 100 * viewport.width; case "maxHeight": case "minHeight": return parseFloat(value) / 100 * viewport.height; default: break; } } return parseFloat(value); } return value; } function constrainHeight(height, values, parentSize, viewport) { if (values.minHeight) { height = Math.max(getConstraintValue("minHeight", values.minHeight, parentSize, viewport), height); } if (values.maxHeight) { height = Math.min(getConstraintValue("maxHeight", values.maxHeight, parentSize, viewport), height); } return height; } function constrainWidth(width, values, parentSize, viewport) { if (values.minWidth) { width = Math.max(getConstraintValue("minWidth", values.minWidth, parentSize, viewport), width); } if (values.maxWidth) { width = Math.min(getConstraintValue("maxWidth", values.maxWidth, parentSize, viewport), width); } return width; } function sizeAfterApplyingConstraintsAndAspectRatio(width, height, values, parentSize, viewport) { let w = constrainWidth(isFiniteNumber(width) ? width : defaultWidth, values, parentSize, viewport); let h = constrainHeight(isFiniteNumber(height) ? height : defaultHeight, values, parentSize, viewport); if (isFiniteNumber(values.aspectRatio) && values.aspectRatio > 0) { if (isFiniteNumber(values.left) && isFiniteNumber(values.right)) { h = w / values.aspectRatio; } else if (isFiniteNumber(values.top) && isFiniteNumber(values.bottom)) { w = h * values.aspectRatio; } else if (values.widthType !== 0 /* FixedNumber */) { h = w / values.aspectRatio; } else { w = h * values.aspectRatio; } } return { width: w, height: h }; } function pinnedOffset(start, end) { if (!isFiniteNumber(start) || !isFiniteNumber(end)) return null; return start + end; } function getMergedConstraintsProps(props, constraints) { const result = {}; if (props.constraints) { result.constraints = { ...props.constraints, ...constraints }; } else { Object.assign(result, constraints); } return result; } // ../../library/src/render/types/NewConstraints.tsx import { Fragment as Fragment3, jsx as jsx5 } from "react/jsx-runtime"; function containsInvalidStringValues(props) { if (typeof props.right === "string") return true; if (typeof props.bottom === "string") return true; if (typeof props.left === "string" && (!props.center || props.center === "y")) { return true; } if (typeof props.top === "string" && (!props.center || props.center === "x")) { return true; } return false; } function constraintsEnabled(props) { if (!props._constraints) return false; if (containsInvalidStringValues(props)) return false; return props._constraints.enabled; } function sizeFromFiniteNumberProps(props) { const { size } = props; let { width, height } = props; if (isFiniteNumber(size)) { if (width === void 0) { width = size; } if (height === void 0) { height = size; } } if (isFiniteNumber(width) && isFiniteNumber(height)) { return { width, height }; } return null; } function rectFromFiniteNumberProps(props) { const size = sizeFromFiniteNumberProps(props); if (size === null) { return null; } const { left, top } = props; if (isFiniteNumber(left) && isFiniteNumber(top)) { return { x: left, y: top, ...size }; } return null; } function calculateRect(props, parentSize, pixelAlign = true) { if (props.positionFixed || props.positionAbsolute) return null; const parentSizeDisabled = parentSize === 1 /* Disabled */ || parentSize === 2 /* DisabledForCurrentLevel */; if (!constraintsEnabled(props) || parentSizeDisabled) { return rectFromFiniteNumberProps(props); } const constraintValues = getConstraintValues(props); const enabledParentSize = deprecatedParentSize(parentSize); const parentSizeInfo = enabledParentSize ? { sizing: enabledParentSize, positioning: enabledParentSize, viewport: null } : null; return ConstraintValues.toRect(constraintValues, parentSizeInfo, null, pixelAlign, null); } function getConstraintValues(props) { const { left, right, top, bottom, center, _constraints, size } = props; let { width, height } = props; if (width === void 0) { width = size; } if (height === void 0) { height = size; } const { aspectRatio, autoSize } = _constraints; const constraintMask = ConstraintMask.quickfix({ left: isFiniteNumber(left), right: isFiniteNumber(right), top: isFiniteNumber(top), bottom: isFiniteNumber(bottom), widthType: valueToDimensionType(width), heightType: valueToDimensionType(height), aspectRatio: aspectRatio || null, fixedSize: autoSize === true }); let widthValue = null; let heightValue = null; let widthType = 0 /* FixedNumber */; let heightType = 0 /* FixedNumber */; if (constraintMask.widthType !== 0 /* FixedNumber */ && typeof width === "string") { const parsedWidth = parseFloat(width); if (width.endsWith("fr")) { widthType = 3 /* FractionOfFreeSpace */; widthValue = parsedWidth; } else if (width === "auto") { widthType = 2 /* Auto */; } else { widthType = 1 /* Percentage */; widthValue = parsedWidth / 100; } } else if (width !== void 0 && typeof width !== "string") { widthValue = width; } if (constraintMask.heightType !== 0 /* FixedNumber */ && typeof height === "string") { const parsedHeight = parseFloat(height); if (height.endsWith("fr")) { heightType = 3 /* FractionOfFreeSpace */; heightValue = parsedHeight; } else if (height === "auto") { heightType = 2 /* Auto */; } else { heightType = 1 /* Percentage */; heightValue = parseFloat(height) / 100; } } else if (height !== void 0 && typeof height !== "string") { heightValue = height; } let centerAnchorX = 0.5; let centerAnchorY = 0.5; if (center === true || center === "x") { constraintMask.left = false; if (typeof left === "string") { centerAnchorX = parseFloat(left) / 100; } } if (center === true || center === "y") { constraintMask.top = false; if (typeof top === "string") { centerAnchorY = parseFloat(top) / 100; } } return { // Because we check isFiniteNumber when creating the masks, // We know that left, right, top and bottom are numbers if the mask is true for the corresponding value // We need to cast this because typescript does not understand that left: constraintMask.left ? left : null, right: constraintMask.right ? right : null, top: constraintMask.top ? top : null, bottom: constraintMask.bottom ? bottom : null, widthType, heightType, width: widthValue, height: heightValue, aspectRatio: constraintMask.aspectRatio || null, centerAnchorX, centerAnchorY, minHeight: props.minHeight, maxHeight: props.maxHeight, minWidth: props.minWidth, maxWidth: props.maxWidth }; } var ParentSizeState = /* @__PURE__ */ ((ParentSizeState2) => { ParentSizeState2[ParentSizeState2["Unknown"] = 0] = "Unknown"; ParentSizeState2[ParentSizeState2["Disabled"] = 1] = "Disabled"; ParentSizeState2[ParentSizeState2["DisabledForCurrentLevel"] = 2] = "DisabledForCurrentLevel"; return ParentSizeState2; })(ParentSizeState || {}); var ConstraintsContext = /* @__PURE__ */ React16.createContext({ parentSize: 0 /* Unknown */ }); function deprecatedParentSize(parentSize) { if (parentSize === 0 /* Unknown */ || parentSize === 1 /* Disabled */ || parentSize === 2 /* DisabledForCurrentLevel */) { return null; } return parentSize; } function useParentSize() { return React16.useContext(ConstraintsContext).parentSize; } function isSize(o) { return typeof o === "object"; } var ProvideParentSize = (props) => { const currentParentSize = useParentSize(); const { parentSize, children } = props; const value = React16.useMemo( () => ({ parentSize }), // We are generating the memoKeys in runtime and react doesn't like it, // but it should be safe to ignore. // eslint-disable-next-line react-hooks/exhaustive-deps [getParentWidth(parentSize), getParentHeight(parentSize)] ); if (currentParentSize === 1 /* Disabled */) { return children ? /* @__PURE__ */ jsx5(Fragment3, { children }) : null; } return /* @__PURE__ */ jsx5(ConstraintsContext.Provider, { value, children }); }; function getParentWidth(parentSize) { return isSize(parentSize) ? parentSize.width : parentSize; } function getParentHeight(parentSize) { return isSize(parentSize) ? parentSize.height : parentSize; } function useProvideParentSize(node, parentSize) { return /* @__PURE__ */ jsx5(ProvideParentSize, { parentSize, children: node }); } function useConstraints(props) { const parentSize = useParentSize(); const calculatedRect = calculateRect(props, parentSize, true); return calculatedRect; } function isAutoSized({ width, height }) { return width === "auto" || width === "min-content" || height === "auto" || height === "min-content"; } // ../../library/src/render/types/PropertyControls.ts var ControlType = /* @__PURE__ */ ((ControlType2) => { ControlType2["Boolean"] = "boolean"; ControlType2["Number"] = "number"; ControlType2["String"] = "string"; ControlType2["RichText"] = "richtext"; ControlType2["FusedNumber"] = "fusednumber"; ControlType2["Enum"] = "enum"; ControlType2["SegmentedEnum"] = "segmentedenum"; ControlType2["Color"] = "color"; ControlType2["Image"] = "image"; ControlType2["ResponsiveImage"] = "responsiveimage"; ControlType2["File"] = "file"; ControlType2["ComponentInstance"] = "componentinstance"; ControlType2["Array"] = "array"; ControlType2["EventHandler"] = "eventhandler"; ControlType2["Transition"] = "transition"; ControlType2["BoxShadow"] = "boxshadow"; ControlType2["Link"] = "link"; ControlType2["Date"] = "date"; ControlType2["Object"] = "object"; ControlType2["Font"] = "font"; ControlType2["PageScope"] = "pagescope"; ControlType2["ScrollSectionRef"] = "scrollsectionref"; ControlType2["CustomCursor"] = "customcursor"; ControlType2["Border"] = "border"; ControlType2["Cursor"] = "cursor"; ControlType2["Padding"] = "padding"; ControlType2["BorderRadius"] = "borderradius"; ControlType2["CollectionReference"] = "collectionreference"; return ControlType2; })(ControlType || {}); // ../../library/src/modules/isFlexboxGapSupported.ts var isFlexboxGapSupportedCached; function isFlexboxGapSupported() { if (isFlexboxGapSupportedCached !== void 0) { return isFlexboxGapSupportedCached; } const flex = document.createElement("div"); Object.assign(flex.style, { position: "absolute", // avoid layout shift display: "flex", flexDirection: "column", rowGap: "1px" }); flex.appendChild(document.createElement("div")); flex.appendChild(document.createElement("div")); document.body.appendChild(flex); const isSupported = flex.scrollHeight === 1; if (flex.parentNode) { flex.parentNode.removeChild(flex); } isFlexboxGapSupportedCached = isSupported; return isSupported; } // ../../library/src/modules/workaroundFlexboxGapNotSupported.ts var flexboxGapNotSupportedClass = "flexbox-gap-not-supported"; var initialized = false; function installFlexboxGapWorkaroundIfNeeded() { if (initialized) return; initialized = true; if (isFlexboxGapSupported()) return; document.body.classList.add(flexboxGapNotSupportedClass); } // ../../library/src/render/utils/injectDeprecatedRichTextRules.ts var richTextStylesRule = ` [data-framer-component-type="DeprecatedRichText"] p, [data-framer-component-type="DeprecatedRichText"] div, [data-framer-component-type="DeprecatedRichText"] h1, [data-framer-component-type="DeprecatedRichText"] h2, [data-framer-component-type="DeprecatedRichText"] h3, [data-framer-component-type="DeprecatedRichText"] h4, [data-framer-component-type="DeprecatedRichText"] h5, [data-framer-component-type="DeprecatedRichText"] h6, [data-framer-component-type="DeprecatedRichText"] li, [data-framer-component-type="DeprecatedRichText"] ol, [data-framer-component-type="DeprecatedRichText"] ul, [data-framer-component-type="DeprecatedRichText"] span:not([data-text-fill]) { font-family: var(--framer-font-family, Inter, Inter Placeholder, sans-serif); font-style: var(--framer-font-style, normal); font-weight: var(--framer-font-weight, 400); color: var(--framer-text-color, #000); font-size: var(--framer-font-size, 16px); letter-spacing: var(--framer-letter-spacing, 0); text-transform: var(--framer-text-transform, none); text-decoration: var(--framer-text-decoration, none); line-height: var(--framer-line-height, 1.2em); text-align: var(--framer-text-alignment, start); } `; var richTextParagraphSpacingStylesRule = ` [data-framer-component-type="DeprecatedRichText"] p:not(:first-child), [data-framer-component-type="DeprecatedRichText"] div:not(:first-child), [data-framer-component-type="DeprecatedRichText"] h1:not(:first-child), [data-framer-component-type="DeprecatedRichText"] h2:not(:first-child), [data-framer-component-type="DeprecatedRichText"] h3:not(:first-child), [data-framer-component-type="DeprecatedRichText"] h4:not(:first-child), [data-framer-component-type="DeprecatedRichText"] h5:not(:first-child), [data-framer-component-type="DeprecatedRichText"] h6:not(:first-child), [data-framer-component-type="DeprecatedRichText"] ol:not(:first-child), [data-framer-component-type="DeprecatedRichText"] ul:not(:first-child), [data-framer-component-type="DeprecatedRichText"] .framer-image:not(:first-child) { margin-top: var(--framer-paragraph-spacing, 0); } `; var richTextBackgroundMaskStylesRule = ` [data-framer-component-type="DeprecatedRichText"] span[data-text-fill] { display: inline-block; background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; } `; var richTextLinkStylesRule = ` [data-framer-component-type="DeprecatedRichText"] a, [data-framer-component-type="DeprecatedRichText"] a span:not([data-text-fill]) { font-family: var(--framer-link-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif)); font-style: var(--framer-link-font-style, var(--framer-font-style, normal)); font-weight: var(--framer-link-font-weight, var(--framer-font-weight, 400)); color: var(--framer-link-text-color, var(--framer-text-color, #000)); font-size: var(--framer-link-font-size, var(--framer-font-size, 16px)); text-transform: var(--framer-link-text-transform, var(--framer-text-transform, none)); text-decoration: var(--framer-link-text-decoration, var(--framer-text-decoration, none)); } `; var richTextLinkHoverStylesRule = ` [data-framer-component-type="DeprecatedRichText"] a:hover, [data-framer-component-type="DeprecatedRichText"] a:hover span:not([data-text-fill]) { font-family: var(--framer-link-hover-font-family, var(--framer-link-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif))); font-style: var(--framer-link-hover-font-style, var(--framer-link-font-style, var(--framer-font-style, normal))); font-weight: var(--framer-link-hover-font-weight, var(--framer-link-font-weight, var(--framer-font-weight, 400))); color: var(--framer-link-hover-text-color, var(--framer-link-text-color, var(--framer-text-color, #000))); font-size: var(--framer-link-hover-font-size, var(--framer-link-font-size, var(--framer-font-size, 16px))); text-transform: var(--framer-link-hover-text-transform, var(--framer-link-text-transform, var(--framer-text-transform, none))); text-decoration: var(--framer-link-hover-text-decoration, var(--framer-link-text-decoration, var(--framer-text-decoration, none))); } `; var richTextLinkCurrentStylesRule = ` a[data-framer-page-link-current], a[data-framer-page-link-current] span:not([data-text-fill]) { font-family: var(--framer-link-current-font-family, var(--framer-link-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif))); font-style: var(--framer-link-current-font-style, var(--framer-link-font-style, var(--framer-font-style, normal))); font-weight: var(--framer-link-current-font-weight, var(--framer-link-font-weight, var(--framer-font-weight, 400))); color: var(--framer-link-current-text-color, var(--framer-link-text-color, var(--framer-text-color, #000))); font-size: var(--framer-link-current-font-size, var(--framer-link-font-size, var(--framer-font-size, 16px))); text-transform: var(--framer-link-current-text-transform, var(--framer-link-text-transform, var(--framer-text-transform, none))); text-decoration: var(--framer-link-current-text-decoration, var(--framer-link-text-decoration, var(--framer-text-decoration, none))); } `; var richTextLinkCurrentHoverStylesRule = ` a[data-framer-page-link-current]:hover, a[data-framer-page-link-current]:hover span:not([data-text-fill]) { font-family: var(--framer-link-hover-font-family, var(--framer-link-current-font-family, var(--framer-link-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif)))); font-style: var(--framer-link-hover-font-style, var(--framer-link-current-font-style, var(--framer-link-font-style, var(--framer-font-style, normal)))); font-weight: var(--framer-link-hover-font-weight, var(--framer-link-current-font-weight, var(--framer-link-font-weight, var(--framer-font-weight, 400)))); color: var(--framer-link-hover-text-color, var(--framer-link-current-text-color, var(--framer-link-text-color, var(--framer-text-color, #000)))); font-size: var(--framer-link-hover-font-size, var(--framer-link-current-font-size, var(--framer-link-font-size, var(--framer-font-size, 16px)))); text-transform: var(--framer-link-hover-text-transform, var(--framer-link-current-text-transform, var(--framer-link-text-transform, var(--framer-text-transform, none)))); text-decoration: var(--framer-link-hover-text-decoration, var(--framer-link-current-text-decoration, var(--framer-link-text-decoration, var(--framer-text-decoration, none)))); } `; var richTextBoldStylesRule = ` [data-framer-component-type="DeprecatedRichText"] strong { font-weight: bolder; } `; var richTextItalicStylesRule = ` [data-framer-component-type="DeprecatedRichText"] em { font-style: italic; } `; var richTextImageRule = ` [data-framer-component-type="DeprecatedRichText"] .framer-image { display: block; max-width: 100%; height: auto; } `; var richTextBlockElementResetRule = ` [data-framer-component-type="DeprecatedRichText"] p, [data-framer-component-type="DeprecatedRichText"] div, [data-framer-component-type="DeprecatedRichText"] h1, [data-framer-component-type="DeprecatedRichText"] h2, [data-framer-component-type="DeprecatedRichText"] h3, [data-framer-component-type="DeprecatedRichText"] h4, [data-framer-component-type="DeprecatedRichText"] h5, [data-framer-component-type="DeprecatedRichText"] h6 { margin: 0; padding: 0; } `; var richTextStylesPresetResetRule = ` [data-framer-component-type="DeprecatedRichText"] .text-styles-preset-reset { --framer-font-family: Inter, Inter Placeholder, sans-serif; --framer-font-style: normal; --framer-font-weight: 500; --framer-text-color: #000; --framer-font-size: 16px; --framer-letter-spacing: 0; --framer-text-transform: none; --framer-text-decoration: none; --framer-line-height: 1.2em; --framer-text-alignment: start; } `; var richTextStylesList = ` [data-framer-component-type="DeprecatedRichText"] ul, [data-framer-component-type="DeprecatedRichText"] ol { display: table; width: 100%; padding-left: 0; margin: 0; } `; var richTextStylesListItem = ` [data-framer-component-type="DeprecatedRichText"] li { display: table-row; counter-increment: list-item; list-style: none; } `; var richTextStylesNumberedListMarker = ` [data-framer-component-type="DeprecatedRichText"] ol > li::before { display: table-cell; width: 2.25ch; box-sizing: border-box; padding-right: 0.75ch; content: counter(list-item) "."; white-space: nowrap; } `; var richTextStylesBulletedListMarker = ` [data-framer-component-type="DeprecatedRichText"] ul > li::before { display: table-cell; width: 2.25ch; box-sizing: border-box; padding-right: 0.75ch; content: "\u2022"; } `; var deprecatedRichTextCSSRules = [ `[data-framer-component-type="DeprecatedRichText"] { cursor: inherit; }`, richTextStylesPresetResetRule, richTextBlockElementResetRule, richTextStylesRule, richTextParagraphSpacingStylesRule, richTextBackgroundMaskStylesRule, richTextLinkStylesRule, richTextLinkHoverStylesRule, richTextLinkCurrentStylesRule, richTextLinkCurrentHoverStylesRule, richTextBoldStylesRule, richTextItalicStylesRule, richTextImageRule, richTextStylesList, richTextStylesListItem, richTextStylesNumberedListMarker, richTextStylesBulletedListMarker ]; // ../../library/src/render/utils/injectRichTextRules.ts var richTextCSSRules = [ /* css */ ` p.framer-text, div.framer-text, h1.framer-text, h2.framer-text, h3.framer-text, h4.framer-text, h5.framer-text, h6.framer-text, ol.framer-text, ul.framer-text { margin: 0; padding: 0; } `, /* css */ ` p.framer-text, div.framer-text, h1.framer-text, h2.framer-text, h3.framer-text, h4.framer-text, h5.framer-text, h6.framer-text, li.framer-text, ol.framer-text, ul.framer-text, span.framer-text:not([data-text-fill]) { font-family: var(--framer-blockquote-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif)); font-style: var(--framer-blockquote-font-style, var(--framer-font-style, normal)); font-weight: var(--framer-blockquote-font-weight, var(--framer-font-weight, 400)); color: var(--framer-blockquote-text-color, var(--framer-text-color, #000)); font-size: calc(var(--framer-blockquote-font-size, var(--framer-font-size, 16px)) * var(--framer-font-size-scale, 1)); letter-spacing: var(--framer-blockquote-letter-spacing, var(--framer-letter-spacing, 0)); text-transform: var(--framer-blockquote-text-transform, var(--framer-text-transform, none)); text-decoration: var(--framer-blockquote-text-decoration, var(--framer-text-decoration, none)); line-height: var(--framer-blockquote-line-height, var(--framer-line-height, 1.2em)); text-align: var(--framer-blockquote-text-alignment, var(--framer-text-alignment, start)); -webkit-text-stroke-width: var(--framer-text-stroke-width, initial); -webkit-text-stroke-color: var(--framer-text-stroke-color, initial); } `, /* css */ ` .framer-fit-text .framer-text { white-space: nowrap; white-space-collapse: preserve; } `, /* css */ ` strong.framer-text { font-family: var(--framer-blockquote-font-family-bold, var(--framer-font-family-bold)); font-style: var(--framer-blockquote-font-style-bold, var(--framer-font-style-bold)); font-weight: var(--framer-blockquote-font-weight-bold, var(--framer-font-weight-bold, bolder)); } `, /* css */ ` em.framer-text { font-family: var(--framer-blockquote-font-family-italic, var(--framer-font-family-italic)); font-style: var(--framer-blockquote-font-style-italic, var(--framer-font-style-italic, italic)); font-weight: var(--framer-blockquote-font-weight-italic, var(--framer-font-weight-italic)); } `, /* css */ ` em.framer-text > strong.framer-text { font-family: var(--framer-blockquote-font-family-bold-italic, var(--framer-font-family-bold-italic)); font-style: var(--framer-blockquote-font-style-bold-italic, var(--framer-font-style-bold-italic, italic)); font-weight: var(--framer-blockquote-font-weight-bold-italic, var(--framer-font-weight-bold-italic, bolder)); } `, /* css */ ` p.framer-text:not(:first-child), div.framer-text:not(:first-child), h1.framer-text:not(:first-child), h2.framer-text:not(:first-child), h3.framer-text:not(:first-child), h4.framer-text:not(:first-child), h5.framer-text:not(:first-child), h6.framer-text:not(:first-child), ol.framer-text:not(:first-child), ul.framer-text:not(:first-child), .framer-image.framer-text:not(:first-child) { margin-top: var(--framer-blockquote-paragraph-spacing, var(--framer-paragraph-spacing, 0)); } `, // The first child of a list item is a paragraph. If the second child is a // nested list we don't want it to have paragraph spacing. /* css */ ` li.framer-text > ul.framer-text:nth-child(2), li.framer-text > ol.framer-text:nth-child(2) { margin-top: 0; } `, // background-clip: text clips to the physical dimensions of text as appose // to the rendered dimensions. normal text will bleed out side these // constraints but since this is just a clipping mask over the area the text // takes up we have cases where the text will get clipped. That is why we // need to expand the area that the gradient applies to to allow users to // use low line-heights. This will result in gradients not aligning // perfectly to the edges of the text. but this is a acceptable trade off at // this point. For now we increase the area of the clipping mask on the // bottom (for descenders) and the right for italic or wide fonts. /* css */ ` .framer-text[data-text-fill] { display: inline-block; background-clip: text; -webkit-background-clip: text; /* make this a transparent color if you want to visualise the clipping */ -webkit-text-fill-color: transparent; padding: max(0em, calc(calc(1.3em - var(--framer-blockquote-line-height, var(--framer-line-height, 1.3em))) / 2)); margin: min(0em, calc(calc(1.3em - var(--framer-blockquote-line-height, var(--framer-line-height, 1.3em))) / -2)); } `, /* css */ ` code.framer-text, code.framer-text span.framer-text:not([data-text-fill]) { font-family: var(--framer-code-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif)); font-style: var(--framer-code-font-style, var(--framer-font-style, normal)); font-weight: var(--framer-code-font-weight, var(--framer-font-weight, 400)); color: var(--framer-code-text-color, var(--framer-text-color, #000)); font-size: calc(var(--framer-font-size, 16px) * var(--framer-font-size-scale, 1)); letter-spacing: var(--framer-letter-spacing, 0); line-height: var(--framer-line-height, 1.2em); } `, /* css */ ` blockquote.framer-text { margin-block-start: initial; margin-block-end: initial; margin-inline-start: initial; margin-inline-end: initial; unicode-bidi: initial; } `, /* css */ ` a.framer-text, a.framer-text span.framer-text:not([data-text-fill]) { font-family: var(--framer-link-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif)); font-style: var(--framer-link-font-style, var(--framer-font-style, normal)); font-weight: var(--framer-link-font-weight, var(--framer-font-weight, 400)); color: var(--framer-link-text-color, var(--framer-text-color, #000)); font-size: calc(var(--framer-link-font-size, var(--framer-font-size, 16px)) * var(--framer-font-size-scale, 1)); text-transform: var(--framer-link-text-transform, var(--framer-text-transform, none)); text-decoration: var(--framer-link-text-decoration, var(--framer-text-decoration, none)); /* Cursor inherit to overwrite the user agent stylesheet on rich text links. */ cursor: var(--framer-custom-cursors, pointer); } `, /* css */ ` code.framer-text a.framer-text, code.framer-text a.framer-text span.framer-text:not([data-text-fill]) { font-family: var(--framer-code-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif)); font-style: var(--framer-code-font-style, var(--framer-font-style, normal)); font-weight: var(--framer-code-font-weight, var(--framer-font-weight, 400)); color: var(--framer-link-text-color, var(--framer-code-text-color, var(--framer-text-color, #000))); font-size: calc(var(--framer-link-font-size, var(--framer-font-size, 16px)) * var(--framer-font-size-scale, 1)); } `, /* css */ ` a.framer-text:hover, a.framer-text:hover span.framer-text:not([data-text-fill]) { font-family: var(--framer-link-hover-font-family, var(--framer-link-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif))); font-style: var(--framer-link-hover-font-style, var(--framer-link-font-style, var(--framer-font-style, normal))); font-weight: var(--framer-link-hover-font-weight, var(--framer-link-font-weight, var(--framer-font-weight, 400))); color: var(--framer-link-hover-text-color, var(--framer-link-text-color, var(--framer-text-color, #000))); font-size: calc(var(--framer-link-hover-font-size, var(--framer-link-font-size, var(--framer-font-size, 16px))) * var(--framer-font-size-scale, 1)); text-transform: var(--framer-link-hover-text-transform, var(--framer-link-text-transform, var(--framer-text-transform, none))); text-decoration: var(--framer-link-hover-text-decoration, var(--framer-link-text-decoration, var(--framer-text-decoration, none))); } `, /* css */ ` code.framer-text a.framer-text:hover, code.framer-text a.framer-text:hover span.framer-text:not([data-text-fill]) { font-family: var(--framer-code-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif)); font-style: var(--framer-code-font-style, var(--framer-font-style, normal)); font-weight: var(--framer-code-font-weight, var(--framer-font-weight, 400)); color: var(--framer-link-hover-text-color, var(--framer-link-text-color, var(--framer-code-text-color, var(--framer-text-color, #000)))); font-size: calc(var(--framer-link-hover-font-size, var(--framer-link-font-size, var(--framer-font-size, 16px))) * var(--framer-font-size-scale, 1)); } `, /* css */ ` a.framer-text[data-framer-page-link-current], a.framer-text[data-framer-page-link-current] span.framer-text:not([data-text-fill]) { font-family: var(--framer-link-current-font-family, var(--framer-link-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif))); font-style: var(--framer-link-current-font-style, var(--framer-link-font-style, var(--framer-font-style, normal))); font-weight: var(--framer-link-current-font-weight, var(--framer-link-font-weight, var(--framer-font-weight, 400))); color: var(--framer-link-current-text-color, var(--framer-link-text-color, var(--framer-text-color, #000))); font-size: calc(var(--framer-link-current-font-size, var(--framer-link-font-size, var(--framer-font-size, 16px))) * var(--framer-font-size-scale, 1)); text-transform: var(--framer-link-current-text-transform, var(--framer-link-text-transform, var(--framer-text-transform, none))); text-decoration: var(--framer-link-current-text-decoration, var(--framer-link-text-decoration, var(--framer-text-decoration, none))); } `, /* css */ ` code.framer-text a.framer-text[data-framer-page-link-current], code.framer-text a.framer-text[data-framer-page-link-current] span.framer-text:not([data-text-fill]) { font-family: var(--framer-code-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif)); font-style: var(--framer-code-font-style, var(--framer-font-style, normal)); font-weight: var(--framer-code-font-weight, var(--framer-font-weight, 400)); color: var(--framer-link-current-text-color, var(--framer-link-text-color, var(--framer-code-text-color, var(--framer-text-color, #000)))); font-size: calc(var(--framer-link-current-font-size, var(--framer-link-font-size, var(--framer-font-size, 16px))) * var(--framer-font-size-scale, 1)); } `, /* css */ ` a.framer-text[data-framer-page-link-current]:hover, a.framer-text[data-framer-page-link-current]:hover span.framer-text:not([data-text-fill]) { font-family: var(--framer-link-hover-font-family, var(--framer-link-current-font-family, var(--framer-link-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif)))); font-style: var(--framer-link-hover-font-style, var(--framer-link-current-font-style, var(--framer-link-font-style, var(--framer-font-style, normal)))); font-weight: var(--framer-link-hover-font-weight, var(--framer-link-current-font-weight, var(--framer-link-font-weight, var(--framer-font-weight, 400)))); color: var(--framer-link-hover-text-color, var(--framer-link-current-text-color, var(--framer-link-text-color, var(--framer-text-color, #000)))); font-size: calc(var(--framer-link-hover-font-size, var(--framer-link-current-font-size, var(--framer-link-font-size, var(--framer-font-size, 16px)))) * var(--framer-font-size-scale, 1)); text-transform: var(--framer-link-hover-text-transform, var(--framer-link-current-text-transform, var(--framer-link-text-transform, var(--framer-text-transform, none)))); text-decoration: var(--framer-link-hover-text-decoration, var(--framer-link-current-text-decoration, var(--framer-link-text-decoration, var(--framer-text-decoration, none)))); } `, /* css */ ` code.framer-text a.framer-text[data-framer-page-link-current]:hover, code.framer-text a.framer-text[data-framer-page-link-current]:hover span.framer-text:not([data-text-fill]) { font-family: var(--framer-code-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif)); font-style: var(--framer-code-font-style, var(--framer-font-style, normal)); font-weight: var(--framer-code-font-weight, var(--framer-font-weight, 400)); color: var(--framer-link-hover-text-color, var(--framer-link-current-text-color, var(--framer-link-text-color, var(--framer-code-text-color, var(--framer-text-color, #000))))); font-size: calc(var(--framer-link-hover-font-size, var(--framer-link-current-font-size, var(--framer-link-font-size, var(--framer-font-size, 16px)))) * var(--framer-font-size-scale, 1)); } `, /* css */ ` .framer-image.framer-text { display: block; max-width: 100%; height: auto; } `, /* css */ ` .text-styles-preset-reset.framer-text { --framer-font-family: Inter, Inter Placeholder, sans-serif; --framer-font-style: normal; --framer-font-weight: 500; --framer-text-color: #000; --framer-font-size: 16px; --framer-letter-spacing: 0; --framer-text-transform: none; --framer-text-decoration: none; --framer-line-height: 1.2em; --framer-text-alignment: start; } `, /* css */ ` ol.framer-text { --list-style-type: decimal; } `, /* css */ ` ul.framer-text, ol.framer-text { display: table; width: 100%; } `, /* css */ ` li.framer-text { display: table-row; counter-increment: list-item; list-style: none; } `, /* css */ ` ol.framer-text > li.framer-text::before { display: table-cell; width: 2.25ch; box-sizing: border-box; padding-inline-end: 0.75ch; content: counter(list-item, var(--list-style-type)) "."; white-space: nowrap; } `, /* css */ ` ul.framer-text > li.framer-text::before { display: table-cell; width: 2.25ch; box-sizing: border-box; padding-inline-end: 0.75ch; content: "\u2022"; } `, /* css */ ` .framer-text-module[style*="aspect-ratio"] > :first-child { width: 100%; } `, /* css */ ` @supports not (aspect-ratio: 1) { .framer-text-module[style*="aspect-ratio"] { position: relative; } } `, /* css */ ` @supports not (aspect-ratio: 1) { .framer-text-module[style*="aspect-ratio"]::before { content: ""; display: block; padding-bottom: calc(100% / calc(var(--aspect-ratio))); } } `, /* css */ ` @supports not (aspect-ratio: 1) { .framer-text-module[style*="aspect-ratio"] > :first-child { position: absolute; top: 0; left: 0; height: 100%; } } ` ]; // ../../library/src/render/utils/setDocumentStyles.ts var defaultCache = /* @__PURE__ */ new Set(); var defaultSheet; function injectCSSRule(cssRule, sheet, cache2 = defaultCache) { if (!cssRule || cache2.has(cssRule) || typeof document === "undefined") return; cache2.add(cssRule); if (!sheet) { if (!defaultSheet) { const styleElement = document.createElement("style"); styleElement.setAttribute("type", "text/css"); styleElement.setAttribute("data-framer-css", "true"); if (!document.head) { console.warn("not injecting CSS: the document is missing a element"); return; } document.head.appendChild(styleElement); if (styleElement.sheet) { defaultSheet = styleElement.sheet; } else { console.warn("not injecting CSS: injected